Exception raised when running ipython notebook - exception

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.

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.

Installing Cairo and PyCairo Mac OsX

I am playing around with using python iGraph for network visualization. I got his error message when I tried to plot a graph:
>>> layout = g.layout("kk")
>>> plot(g, layout = layout)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/igraph/drawing/__init__.py", line 446, in plot
File "build/bdist.macosx-10.5-x86_64/egg/igraph/drawing/__init__.py", line 117, in __init__
File "build/bdist.macosx-10.5-x86_64/egg/igraph/drawing/utils.py", line 396, in __getattr__
TypeError: plotting not available
I don't think I installed Cairo or PyCairo correctly.
I am not familiar using Fink or MacPorts, since I commonly use Homebrew.
Any help you be greatly appreciated.
You need to manually compile the library. I used the solution here and just updated the version.
curl -L https://www.cairographics.org/releases/cairo-1.14.6.tar.xz -o cairo.tar.xz
tar -xf cairo.tar.xz && cd cairo-1.14.6
./configure --prefix=/usr/local --disable-dependency-tracking
make install
If while running configure, you get an error about pkg_config, you can install that with brew:
brew install pkg-config
I had the same problem on my MacBook so I wanted to share my solution.
I tried to install pycairo, py2cairo. The installation seemed to be okay but then:
I could not import pycairo
igraph's plot would not work.
The following solved the igraph plotting issue:
sudo pip install cairocffi
or just
pip install cairocffi
So instead of pycairo I used cairocffi and this did the trick.
As Mads said in a comment, brew install cairo works, it solved a related problem for me, so I'm posting here for people who end up here why troubleshooting cairo on OS X.
Accepted answer lead to an error of libpng missing, homebrew on the other hand installed all dependencies correctly.

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

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.