Mercurial produces strange messages - mercurial

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.

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.

TortoiseHg error running HG

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

Using MPI4PY in FedoraScientific

Recently, I downloaded and installed Fedora Scientific 20 as I was
impressed with the list of included software. My interest in the software
is due to the inclusion of the MPI framework. I was able to compile and
execute a simple C program using mpicc and mpiexec. However, I need some
help using MPI4PY to call OpenMPI using Python code.
At the terminal prompt, if I try:
$ /lib64/openmpi/bin/mpiexec -n 2 python3 helloworld.py
The Traceback reports that an
ImportError: No module named 'mpi4py'
has been raised. The helloworld.py program was an example found online with
line 6 being from mpi4py import MPI.
Since Apper indicates that mpi4py has been installed for both Python2 and
Python3 for OpenMPI as part of the installation of Fedora Scientific, I'm not sure what might be wrong. Could somebody please advise as to how to use this package?
It sounds like there is something wrong with your environment. Perhaps mpi4py, since you have confirmed it is installed, is installed in a a strange place. Would setting PYTHONPATH help?
https://docs.python.org/2/using/cmdline.html#environment-variables

Exception raised when running ipython notebook

I used to have ipython notebook working correctly in fedora, but then tried to get ipython notebook for julia with Pkg.build("IJulia") and Pkg.add("IJulia").
After doing this and updating my ipython version with pip I could not run ipython notebook anymore, the next exception was raised over and over again:
ERROR:root:Exception in I/O handler for fd 6
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.py", line 346, in start
self._handlers[fd](fd, events)
KeyError: 6
^C2014-08-12 22:51:35.024 [NotebookApp] CRITICAL | received signal 2, stopping
Any help would be very much appreciated.
Thanks in advance :)
Getting IJulia to work is lot easier now, Pkg.add("IJulia") will search for jupyter or ipython in PATH, if not found it will use Conda.jl to install the dependencies. Another option which was tried successfully by the OP is to separately install Jupyter(which comes along Anaconda) to system path, and then install IJulia. Then should be able to open the notebooks by,
julia>using IJulia
julia>notebook
Alternatively you can open a notebook by running jupyter notebook in the command line.
PS : Credits to OP and commenters.