I get a ModuleNotFoundError: No module named 'pyedflib' even though pyedflib has been installed (when checked, it says requirement satisfied).
I have uninstalled it and reinstalled to make sure it installed correctly. Numpy requirement is satisfied. Has anyone else come across this error?
You can try creating a virtual environment and install pyedflib
python3 -m venv venv
source venv/bin/activate
pip install pyEDFlib
now you can run python3 in the same environment and get the import working
python3
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyedflib
Related
Unable to import mlflow in a .py script.
ModuleNotFoundError: No module named 'mlflow'
The script runs in a python:3.7-stretch Docker container
Use requirements.txt to pip install packages.
(...)
sqlalchemy==1.4.1
psycopg2==2.8.6
mlflow==1.18.0
RUN pip3 install --default-timeout=5000 --use-deprecated=legacy-resolver -r /root/requirements.txt
Can see that it is installed.
root#abc:~# pip uninstall mlflow
Found existing installation: mlflow 1.18.0
Uninstalling mlflow-1.18.0:
Would remove:
/usr/local/bin/mlflow
/usr/local/lib/python3.7/site-packages/mlflow-1.18.0.dist-info/*
/usr/local/lib/python3.7/site-packages/mlflow/*
Proceed (y/n)? n
Can do an import from python shell.
root#abc:~# python
Python 3.7.10 (default, Feb 16 2021, 19:46:13)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>> import mlflow
>>>
But no joy when running from .py script.
Other packages installed from requirements.txt can be imported.
Any ideas what is wrong ?
I have python3.7 installed but also python3.4. For example:
$ python3
Python 3.4.3 (default, Nov 12 2018, 22:25:49)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
And:
$ python3.7
Python 3.7.0 (default, Jun 28 2018, 00:00:00)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
How can I install packages to python3.7 ? Any pip3 command I use goes to python3.4 and I'm not sure how to install anything for python3.7. Any ideas? Even running something like this doesn't work:
$ python3.7 -m ensurepip --upgrade
/usr/bin/python3.7: No module named ensurepip
Or:
$ sudo python3.7 -m pip install PyMySQL
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
I don't know whether this may be an appropriate solution for you. But this is what I generally follow.
Just install Anaconda in your system and create different environments according to your needs.
For your case create two different environments one for Python 3.4.3 and another for Python 3.7 using the following command
conda create --name py34 python=3.4.3 and
conda create --name py37 python=3.7
//This lines will create two new environments named py34 and py37
You then install libraries according to your needs in the respective environment. Now you can work into each environment without interfering with the libraries of the other environment.
To use anaconda kindly follow Anaconda cheatsheet. You will get everything that you need.
Hope this will help you.
This might help : It addresses the same issue as yours. In short, try
python3.7 -m pip install pip
Here's a reference documentation
This might be a bug, but: if I create a virtualenv while using a Pipenv environment that virtualenv always has access to site packages for that Pipenv environment.
$ pipenv install numpy
Creating a virtualenv for this project…
...
$ pipenv run python -m venv venv # Default behaviour is not to allow access to site-packages
$ source venv/bin/activate
(venv) $ python
Python 3.7.2 (default, May 1 2019, 12:27:28)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>>
Why is this happening?
Can I avoid it?
I am running Ubuntu Linux 18.04 on Virtual box,
I have installed tensorflow properly in venv and import works fine and also
I could run some sample programs with tensorflow, but when i try help(tf) python prompt as show below in the logs, I am hitting coredump,
`(venv) shiv#shiv-vbox:~/TF$ python
Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> x=0
>>> help(x)
>>> help(tf)
Segmentation fault (core dumped)`
Is something wrong with my installation? i tried multiple times to install to confirm some issue with install but all the time I am getting cordump when I do help(tf), any inputs on this would be helpful.
-Thank you
update
I followed following steps to install
shiv#shiv-vbox:~/TF$ sudo virtualenv --system-site-packages -p python3 ./venv
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/shiv/TF/venv/bin/python3
Also creating executable in /home/shiv/TF/venv/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
shiv#shiv-vbox:~/TF$ source ./venv/bin/activate
(venv) shiv#shiv-vbox:~/TF$
(venv) shiv#shiv-vbox:~/TF$ ls
Tflow venv
(venv) shiv#shiv-vbox:~/TF$ pip install --upgrade pip
Requirement already up-to-date: pip in ./venv/lib/python3.6/site-packages (18.1)
(venv) shiv#shiv-vbox:~/TF$ pip install tensorflow
I don't understand why Python3 is giving me an module not find error on importing JayDeBeApi3 module.
import JayDeBeApi3
ModuleNotFoundError: No module named 'JayDeBeApi3'
Please below, JayDeBeApi3 is successfully installed
pip3 install JayDeBeApi3
Collecting JayDeBeApi3
Using cached JayDeBeApi3-1.3.2.tar.gz
Requirement already satisfied: py4j in /usr/local/lib/python3.6/site-packages (from JayDeBeApi3)
Installing collected packages: JayDeBeApi3
Running setup.py install for JayDeBeApi3 ... done
Successfully installed JayDeBeApi3-1.3.2
BELOW IS PYTHONPATH SETTING
Python 3.6.0 (default, Nov 27 2017, 11:04:30)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux
Type "help", "copyright", "credits" or "license" for more information.
import sys
print (sys.path)
['', '/usr/local/lib/python36.zip', '/usr/local/lib/python3.6', '/usr/local/lib/python3.6/lib-dynload', '/root/.local/lib/python3.6/site-packages', '/usr/local/lib/python3.6/site-packages']
# locate JayDeBeApi3
usr/local/lib/python3.6/site-packages/JayDeBeApi3-1.3.2-py3.6.egg-info
/usr/local/lib/python3.6/site-packages/JayDeBeApi3-1.3.2-py3.6.egg-info/PKG-INFO
/usr/local/lib/python3.6/site-packages/JayDeBeApi3-1.3.2-py3.6.egg-info/SOURCES.txt
/usr/local/lib/python3.6/site-packages/JayDeBeApi3-1.3.2-py3.6.egg-info/dependency_links.txt
/usr/local/lib/python3.6/site-packages/JayDeBeApi3-1.3.2-py3.6.egg-info/installed-files.txt
/usr/local/lib/python3.6/site-packages/JayDeBeApi3-1.3.2-py3.6.egg-info/requires.txt
/usr/local/lib/python3.6/site-packages/JayDeBeApi3-1.3.2-py3.6.egg-info/top_level.txt
Downloading JayDeBeApi3 1.3 from https://pypi.python.org/pypi/JayDeBeApi3/1.3 and installing it locally resolved the issue for me. Though, I am sure, that's not an actual solution.