TortoiseHg error running HG - mercurial

I'm running into an error when pushing a local repository to the master repository located on a network share in Windows 7. I've added a hook on the master repository to perform "hg update" on push. When I'm running push from the local repository in the TortoiseHg, I get this error in the console:
Traceback (most recent call last):
File "c:\Python26\lib\site-packages\py2exe\boot_common.py", line 92, in <module>
ImportError: No module named linecache
Traceback (most recent call last):
File "<install zipextimporter>", line 1, in <module>
ImportError: No module named zipextimporter
Traceback (most recent call last):
File "hg", line 10, in <module>
ImportError: No module named os
warning: changegroup hook exited with status 255
The push happens, but does not successfully execute the hook. Furthermore, it seems I get this error all the time I run the "hg" command in the command line, except when running it inside the C:\Program Files\TortoiseHg directory. I've put the "C:\Program Files\TortoiseHg" in the PATH environment variable, but without any success. The system is Windows 7 x64.
In general TortoiseHg seem to work, like commit, update, push, pull... But finer details like hooks seem to not work. I've installed Tortoise 3.5.1 ONLY, without any Mercurial or Python. Here is where I've installed it from:
http://bitbucket.org/tortoisehg/files/downloads/tortoisehg-3.5.1-x64.msi
http://tortoisehg.bitbucket.io/download/index.html
Can somebody help me? I've seen a similar question on StackOverflow, but the person had both Mercurial and TortoiseHg installed.
So, why do I get these errors when running hg in the command line? Why pushing from TortoiseHg GUI doesn't successfully execute the hook on the remote repository?

If traceback is from push-target, then
You have Python 2.6 on it ('File "c:\Python26\lib\site-packages\py2exe\boot_common.py"...')
Mercurial 3.5 (thus - TortoiseHG also) dropped compatibility with Python 2.6, AFAICR, but:
THG uses Python's modules, if $PYTHON part is earlier in PATH and hg called outside THG home (in the latter case bundled with THG modules used); and pwd for running hook is always repo-dir
Change order in PATH (TBT!) or update Python to 2.7 or remove current Python from PATH
Why pushing from TortoiseHg GUI doesn't successfully execute the hook on the remote repository?
Because:
hook is push-target task, unrelated to push-source
You have troubles with hg (called in hook) on server's side, which are not related to client's THG

Related

PyModbusTCP module installation on windows pc

Last year, I made a program using the PyModbusTCP module on a raspberry Pi. Now I want to try my programs again on a windows pc but I can't seem to get my installations correct.
Here is some info:
project has a venv folder and a main.py next to it. I am not sure if the main.py has to be in the venv folder or not.
PyModbusTCP has been installed using git cmd with the command "pip3 install pyModbusTCP" and gives me a message "requirement already satisfied..."
Message in console after using a basic program provided by the pymodbustcp dev:
C:\Users\SESA681397\PycharmProjects\pythonProject\venv\Scripts\python.exe C:\Users\SESA681397\PycharmProjects\pythonProject\test.py
Traceback (most recent call last):
File "C:\Users\SESA681397\PycharmProjects\pythonProject\test.py", line 1, in <module>
from pyModbusTCP.client import ModbusClient
ModuleNotFoundError: No module named 'pyModbusTCP'
Thank you for your time reading this, it is probably a stupid problem but i don't know it.
I tried to get the folder correctly and see if pymodbustcp module is correctly installed.
Tried to see if the module is installed and if my previous programs worked.

Pygame auto-py-to-exe gets stuck after selecting script location [duplicate]

I try to install Auto-Py-to-exe but they have a lot of error appear during the installation but at the end it sais successfully installed, see picture below.
I have windows 10pro, PyCharm community 2020.3.3, and i use python 3.9.1 for almost all my projects.
I have uninstall auto-Py-to-exe, piwin, PYpiwin32, pywin32, PyInstaller. Close all the system and reboot, re-install all these module, but nothing seem to work. It the same error when i use Python 3.6 or 3.7. the same error arrived in PyCharm terminal and in the promt(cmd) window terminal.
C:\Windows\system32>auto-py-to-exe
Traceback (most recent call last):
File "c:\users\mélissa\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None, File "c:\users\mélissa\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals) File "C:\Users\Mélissa\AppData\Local\Programs\Python\Python39\Scripts\auto-py-to-exe.exe\__main__.py", line 7, in <module>
File "c:\users\mélissa\appdata\local\programs\python\python39\lib\site-packages\auto_py_to_exe\__main__.py", line 291, in run
if eel.chrome.get_instance_path() is not None and not disable_chrome:AttributeError: module 'eel.chrome' has no attribute 'get_instance_path'
C:\Windows\system32>
I have made the update of PIP, EEL, PYInstaller( the upper version they want to install is 3.2.1, the other fail), gevent and greenlet but i receive always the same error message.
I don't know what to do. I have check here for answer or direction to resolve my problem but i find nothing for now.
the error message in PYCharm, it the same in window terminal
It appears, while looking at the traceback, that the error is in the source code, and not your own execution. Looking through the auto-py-to-exe GitHub repository files, it seems that the package just uses pyinstaller to convert the python script(s) to executable files. In this case, I would recommend just using pyinstaller itself.
To convetr the .py file to a single file, run:
pyinstaller my_script.py --onefile --windowed
The .exe file will appear in a folder dist/ (created during the build). The build/ folder along with other files created during the process can be deleted.

Tortoise-Hg (mercurial) does not find hg-git

I have Tortoise Hg installed on my Windows box, and have been using mercurial via the Tortoise GUI and also from the windows commandline. I installed hg-git as recommended on http://hg-git.github.com/ : Using easy_install hg-git, which built the package with Microsoft Visual C++ 2008. There were no error messages and the build reported success.
I then added the extension to the configuration file. But TortoiseHg still doesn't accept git urls, and when I run hg from the commandline, I get:
*** failed to import extension hggit: No module named hggit
Now, python does know about hggit and will find it if I type import hggit at the interpreter (it fails when hggit tries to import mercurial). I understand that TortoiseHg provides it own python environment, so my question is: How do I install hggit so that it is visible to the tortoise-distributed mercurial? Or am I misdiagnosing the problem?
How did you reference the extension in the .hgrc file ?
If you just did
[extensions]
hggit=
Try adding the complete path to the extension :
[extensions]
hggit = [path-to]/hg-git/hggit
This should tell TortoiseHg exactly where to look and bypass any difference of configuration between the command line and the gui.

Mercurial produces strange messages

I'm typing hg st as my regular ritual when working with Mercurial.
But today Mercurial is acting up on me, it produces
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "/usr/local/bin/hg", line 10, in <module>
import os
ImportError: No module named os
This same error appear when I type hg branches and any other hg commands.
Do you know what is going on and how to solve this problem?
EDIT:
So I was running Mac OS X, and working with Xcode.
I have several Xcode versions in the machine,
some of them are Xcode4 (including Xcode beta versions).
I remember when I couldn't uninstall Xcode4 from script
I delete the Xcode4 folder manually, and then the error appear every time I type hg something.
EDIT:
I uninstalled all Xcode versions, and Pythons still not working so I reInstall the OS, now it works.
Your Python installation is broken.
I don't know exactly what you've done for this to happen, but Python is unable to find the os module, this has nothing specific to do with Mercurial.
Depending on your operating system, the easiest way to resolve this will be to reinstall Python from scratch.

I easy_install'ed Mercurial, and now I get "No script named 'hg'"

I installed Mercurial on (32-bit) Ubuntu 9.10, using:
sudo easy_install mercurial
It installed Mercurial 1.7.5.
I have since learned that using this way of installing is denounced by the Mercurial Team, although the reasons why it shouldn't work are not clear.
When I ran the command hg it responded:
Traceback (most recent call last):
File "/usr/local/bin/hg", line 5, in <module>
pkg_resources.run_script('mercurial==1.7.5', 'hg')
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 448, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1160, in run_script
raise ResolutionError("No script named %r" % script_name)
pkg_resources.ResolutionError: No script named 'hg'
How do I fix this? How do I easy_uninstall it?
Note: I have noticed sudo hg works.
Go to /usr/local/lib/python2.6/dist-packages (or the appropriate directory for your Python install).
Type ls -l and you will find an entry something like so.
drwx--S--- 5 root staff 4096 Feb 14 11:13 mercurial-1.7.5-py2.6-linux-i686.egg
You don't have access to that if you are not logged in as root. Try:
sudo chmod -R o+rX mercurial-1.7.5-py2.6-linux-i686.egg/
That gives you access and was enough to get things going again for me.
I still don't know how to uninstall the original mess that was made.