Jupyter install for Python 2.7 failed - python

I have the Anaconda distribution of Python 2.7 and I needed to install the Jupyter notebook package. During the installation process my computer turned off and after that I couldn't continue with the process. I tried to uninstall Jupyter and try installing it again, but I keep getting the same error:
Traceback (most recent call last):
File "C:\Users\Acer\Anaconda\Scripts\ipython-script.py", line 3, in <module>
from IPython import start_ipython
File "C:\Users\Acer\Anaconda\lib\site-packages\IPython\__init__.py", line 49, in <module>
from .terminal.embed import embed
File "C:\Users\Acer\Anaconda\lib\site-packages\IPython\terminal\embed.py", line 19, in <module>
from IPython.terminal.ipapp import load_default_config
File "C:\Users\Acer\Anaconda\lib\site-packages\IPython\terminal\ipapp.py", line 22, in <module>
from IPython.core.completer import IPCompleter
File "C:\Users\Acer\Anaconda\lib\site-packages\IPython\core\completer.py", line 71, in <module>
from IPython.utils import generics
File "C:\Users\Acer\Anaconda\lib\site-packages\IPython\utils\generics.py", line 8, in <module>
from simplegeneric import generic
ImportError: No module named simplegeneric
What should I remove/add in order to make it work?

You need to install the python package simplegeneric. After you install it, you need to install the next package that you fail to import. Continue this process until you dont get any import errors.

Related

Python modulenotfound error - Is there a "pip" alternative way to install python modules

I am trying to run a program (obviously written in python) and it requires some python modules. One of the missed modules is aiomultiprocess. I tried installing it with pip install aiomultiprocess pip3 install aiomultiprocess python3.7 -m pip install aiomultiprocess but they all come back with the same error message:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 19, in <module>
from setuptools.dist import Distribution
File "/usr/local/lib/python3.7/site-packages/setuptools/dist.py", line 34, in <module>
from setuptools import windows_support
File "/usr/local/lib/python3.7/site-packages/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/usr/local/lib/python3.7/ctypes/__init__.py", line 10, in <module>
from _ctypes import Union, Structure, Array
File "/usr/local/lib/python3.7/_ctypes.py", line 5, in <module>
import ffi
ModuleNotFoundError: No module named 'ffi'
No ffi module?! Let's get it!
I looked it up and figured it's a foreign library that come, in the case of python, as 2 forms: CFFI & LibFFI, but "ffi" doesn't exist for python. I installed cffi libffi and added them to this path /usr/local/lib/python3.7/site-packages/, but it changed nothing.
So my question is there another way to install python modules without the need of pip??!

Issue with dependencies -- ImportError: cannot import name getfullargspec

I'm trying to use mayavi in python to visualize a pointcloud, and cannot resolve this error. I'm sure it is an easy pip install, but I am unsure of the command. Any help is much appreciated! Thanks!
BTW, I am running Ubuntu 18.04 and have tried installing scipy as mentioned here: Python import error "getfullargspec". I have also ran pip install traitsui. Additionally, I have rebooted my system.
Update:
After further digging, it appears that it may be an issue with Python versions. I was able to get it to run with Python3, but not Python 2.7 (I need it to work with python 2). I have also tried modifying the code within handler.py to getargspec instead of getfullargspec. I was given an error about trait_factory by doing this
Here is the entire printout:
Traceback (most recent call last):
File "mayavi_test.py", line 3, in <module>
from mayavi import mlab
File "/home/user/.local/lib/python2.7/site-packages/mayavi/mlab.py", line 16, in <module>
from mayavi.tools.camera import view, roll, yaw, pitch, move
File "/home/user/.local/lib/python2.7/site-packages/mayavi/tools/camera.py", line 24, in <module>
from .engine_manager import get_engine
File "/home/user/.local/lib/python2.7/site-packages/mayavi/tools/engine_manager.py", line 12, in <module>
from mayavi.preferences.api import preference_manager
File "/home/user/.local/lib/python2.7/site-packages/mayavi/preferences/api.py", line 4, in <module>
from .preference_manager import preference_manager
File "/home/user/.local/lib/python2.7/site-packages/mayavi/preferences/preference_manager.py", line 29, in <module>
from traitsui.api import View, Group, Item
File "/home/user/.local/lib/python2.7/site-packages/traitsui/api.py", line 37, in <module>
from .editors.api import (
File "/home/user/.local/lib/python2.7/site-packages/traitsui/editors/__init__.py", line 26, in <module>
from .api import (
File "/home/user/.local/lib/python2.7/site-packages/traitsui/editors/api.py", line 6, in <module>
from .array_editor import ArrayEditor
File "/home/user/.local/lib/python2.7/site-packages/traitsui/editors/array_editor.py", line 34, in <module>
from ..view import View
File "/home/user/.local/lib/python2.7/site-packages/traitsui/view.py", line 41, in <module>
from .ui import UI
File "/home/user/.local/lib/python2.7/site-packages/traitsui/ui.py", line 51, in <module>
from .handler import Handler, ViewHandler
File "/home/user/.local/lib/python2.7/site-packages/traitsui/handler.py", line 27, in <module>
from inspect import getfullargspec
ImportError: cannot import name getfullargspec
The solution for this problem was to use older packages. Not all of the dependencies such as traitsui are compatible with Python 2.7. Even though an older version of mayavi was installed, the dependencies that are installed automatically are not compatible (they only support Python 3).
Here are the versions that work well together for me:
mayavi==4.6.2
traitsui==6.1.3
traits==5.2.0
numpy==1.17.4
pyface==6.1.2
To install a specific version, just run sudo pip install packageName==#.#.#

Import error while trying to run jupyter notebook

An import error occurs when trying to run jupyter notebook
I'm trying to run jupyter notebook using anaconda (git bash platform), and as I type in jupyter notebook, an import error occurs every time. I tried to lauch it inside an environment, but the same error occured.
$ jupyter notebook
Traceback (most recent call last):
File "C:\Users\User\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in
<module>
from notebook.notebookapp import main
File "C:\Users\User\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 47, in <module>
from zmq.eventloop import ioloop
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\select.py", line 27, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed: The specified module could not be found.
EDITED
After reinstalling pyzmq (and I tried reinstalling conda too), the following error occurs:
$ jupyter notebook
Traceback (most recent call last): File
"C:\Users\User\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py",
line 10, in
import sqlite3
File "C:\Users\User\Anaconda3\lib\sqlite3__init__.py", line 23, in
from sqlite3.dbapi2 import *
File "C:\Users\User\Anaconda3\lib\sqlite3\dbapi2.py", line 27, in
from _sqlite3 import *
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:\Users\User\Anaconda3\Scripts\jupyter-notebook-script.py", line 6,
in
from notebook.notebookapp import main
File
"C:\Users\User\Anaconda3\lib\site-packages\notebook\notebookapp.py",
line 86, in
from .services.sessions.sessionmanager import SessionManager
File
"C:\Users\User\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py",
line 13, in
from pysqlite2 import dbapi2 as sqlite3
ModuleNotFoundError: No module named 'pysqlite2'
I found a similar issue open on GitHub for zmq. The recommendation by GitHub user harsh23tyagi that seems to work for most is to run the following:
pip uninstall pyzmq
pip install pyzmq
Working with conda env, jupyter notebook worked in (base) env but gave the .libzmq error in (my_env).
To be able to run notebooks from my_env, this worked for me :
pip uninstall pyzmq
pip install pyzmq==20 (no version for pyzmq didn't fix the issue for me)
It seems that updating pyzmq to the latest version fixes this problem for me.
conda install pyzmq=22

No Python module despite installing it

I've installed xxhash module with:
sudo pip install --upgrade pip
sudo pip install xxhash
But when I execute:
pydoc modules
I get a list of available modules in which there's no xxhash.
And when I run in terminal a GUI program it gives me an error:
Python: Traceback (most recent call last):
File "./runserver.py", line 34, in <module>
from pogom.search import search_overseer_thread, fake_search_loop
File "/SOME_PATH/resources/app/map/pogom/search.py", line 30, in <module>
from pgoapi import PGoApi
File "/SOME_PATH/resources/app/map/pogom/pgoapi/__init__.py", line 39, in <module>
Python: from .pgoapi import PGoApi
File "/SOME_PATH/resources/app/map/pogom/pgoapi/pgoapi.py", line 34, in <module>
from .rpc_api import RpcApi
File "/SOME_PATH/resources/app/map/pogom/pgoapi/rpc_api.py", line 47, in <module>
from .utilities import to_camel_case, get_time, get_format_time_diff, Rand48, long_to_bytes, generateLocation1, generateLocation2, generateRequestHash, f2i
File "/SOME_PATH/resources/app/map/pogom/pgoapi/utilities.py", line 37, in <module>
import xxhash
ImportError: No module named xxhash
BTW, the 2 first commands worked with no error and when I rerun them it says that these modules are already installed and up to date.

Getting error when importing some package on python scripts

Here is my error:
Traceback (most recent call last):
File "./convert.py", line 6, in <module>
import openpyxl # from https://pythonhosted.org/openpyxl/ or PyPI (e.g. via pip)
ImportError: No module named openpyxl
i have installed the python package openpyxl but this error still appear
Im using linux python version 2.6.6
any help please
i got this new error when i ran the python2.7 script.py:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 7, in <module>
from pip import main
File "/usr/local/lib/python2.7/site-packages/pip/__init__.py", line 13, in <module>
from pip.utils import get_installed_distributions, get_prog
File "/usr/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 15, in <module>
import zipfile
File "/usr/local/lib/python2.7/zipfile.py", line 6, in <module>
import io
File "/usr/local/lib/python2.7/io.py", line 51, in <module>
import _io
ImportError: /usr/local/lib/python2.7/lib-dynload/_io.so: undefined symbol: _PyErr_ReplaceException
openpyxl module has 2 dependent modules : 1. jdcal 2. et_xmlfile
I was able to install openpyxl module and this is what I did :
1.Downloaded the openpyxl,jdcal and et_xmlfile from https://pypi.python.org/pypi and saved jdcal-1.0.tar.gz, et_xmlfile-1.0.0.tar.gz,openpyxl-2.3.0-b2.tar.gz in a local folder in my system.
2.Then I ran the commands in the following order :
pip install jdcal-1.0.tar.gz
pip install et_xmlfile-1.0.0.tar.gz
pip install openpyxl-2.3.0-b2.tar.gz
openpyxl got successfully after this. Please check whether this helps.

Categories