ModuleNotFoundError: No module named 'deeppavlov' in jupyter notebook - python

I've created a virtual enviornment (deepnlp) and installed the deeppavlov package in the virtual env. I could run "import deeppavlov" without any problem on the command line in the env. But when I tried to do the same thing ('import deeppavlov') in the jupyter notebook, in the kernel 'deepnlp', but I got the error mesaage:
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'deeppavlov'
Has anyone encountered the same problem and found out the solution? This problem may or may have to do with the package 'deeppavlov'. It could be because something else.
Thanks.

As far as I know, installing a package to virtualenv has nothing to do with your Jupyter (unless the same interpreter is used in both cases). The solution would be to run the following command in jupyter cell:
import sys
!{sys.executable} -m pip install --user deeppavlov

Related

Cannot use the package "openexr" in python within Blender

I've installed the "openexr" package within my windows system. To do this, i used powershell from my blender installation folder "C:\Program Files\Blender Foundation\Blender 3.0\3.0\python" to launch the command ".\bin\python.exe -m ensurepip", for installing pip, and then "pip install openexer" to install the package.
Everything seems fine, but when I open blender and start to code with a simple
import openexr
I obtain this error:
Traceback (most recent call last):
File "\Text", line 1, in <module>
ModuleNotFoundError: No module named 'openexr'
Error: Python script failed, check the message in the system console
The module seems installed, but it's like blender cannot access it. Someone can help me? I would be extremely happy if this could work !
At the moment I tried to re-install pip or the openexr package, but the problem persist.
Also, if I try to re-install openexr, the system answer me that the package is already installed.

How to install packages in Anaconda environment in VScode?

I am running my code in VScode, my python interpreter being Anconda3\python.exe . When running the following code : -
from Ipython import display
I encounter the following error in the python terminal :
PS C:\Users\Clover\Desktop\Speech Recognition> C:/ProgramData/Anaconda3/python.exe "c:/Users/Clover/Desktop/Speech Recognition/ml_code_first.py"
Traceback (most recent call last):
File "c:/Users/Clover/Desktop/Speech Recognition/ml_code_first.py", line 11, in <module>
from Ipython import display
ModuleNotFoundError: No module named 'Ipython'
I've tried to install it on the conda terminal using :
pip install ipython
and it shows that requirement already satisfied which means the package is installed but why is this package not detected in VScode?
At least there is the warning from the conda developers: Never mix conda-forge installs and pip installs. This might help.

Cannot run Spyder because No module named 'PySide'

I wanted to try using Spyder IDE. I was reading this page on how to open and run Spyder: https://github.com/spyder-ide/spyder/releases
I typed the following commands as specified in the page:
conda update qt pyqt
conda update spyder
Both commands gave "# All requested packages already installed.".
I then typed spyder into my terminal (Mac):
Macs-MacBook:~ macuser$ spyder
Traceback (most recent call last):
File "/anaconda3/lib/python3.6/site-packages/qtpy/__init__.py", line 166, in <module>
from PySide import __version__ as PYSIDE_VERSION # analysis:ignore
ModuleNotFoundError: No module named 'PySide'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/anaconda3/bin/spyder", line 11, in <module>
sys.exit(main())
File "/anaconda3/lib/python3.6/site-packages/spyder/app/start.py", line 159, in main
from spyder.app import mainwindow
File "/anaconda3/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 49, in <module>
So, I tried to install PySide:
Macs-MacBook:~ macuser$ conda install PySide
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
- anaconda==5.2.0=py36_3
- pyside
Use "conda info <package>" to see the dependencies for each package.
What should I do to get up and running with Spyder?
try below commands let me know if it works.
pip install msgpack
conda install qt=5.6 pyqt=5.6 sip=4.18
While other solutions found on the web didn't work for me (such as the one above and using $ pip install pyqt5), I solved this by uninstalling and reinstalling Spyder via terminal, using pip.
$ pip uninstall spyder
...
$ pip install spyder
...
Not sure why, but it worked on the first try.
Mr J.
I had the same problem as Doug Fir. I used these commands. I launched spyder from the DOS prompt. I got "RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa" as was the case before. Just as I was rolling my eyes, Spyder went ahead and started. So I think it worked.
Try to delete the .condarc file. I do not know the specific reason but I faced the same issue and when I deleted the .condarc file it worked for me.
I had same error on Linux and solved deleting:
rm -rf .local/lib/python3.9/
rm -rf .local/share/Spyder/

Python Virtualenv : ImportError: No Module named Zroya

I was trying to work with python virtualenv on the Zroya python wrapper around win32 API. Although I did installed the modules using pip, and although they are shown in cli using the command
pip freeze
,when trying to execute the .py file that uses the modules it shows the following error.
Traceback (most recent call last):
File "TesT.PY", line 2, in <module>
from zroya import NotificationCenter
ImportError: No module named 'zroya'
What is the reason for this cause ? I'm using python 3.4. When checked on
>>>help("modules")
on python cli, the modules that were installed using pip aren't listed.
Your virtualEnv is separate from OS Python environment.
Check whether you installed 'zroya' module in OS Python env or virtualEnv.
Run bin/activate in your virtual env, and check if 'zroya' module exists
>>>help("modules")
If no module named Zroya, run install command pip install xxx after activating virtual env.
Installing zroya should solve your problem.
Installation instructions: https://pypi.python.org/pypi/zroya
There seems to be some issue with the pip install. Copying the zroya directory from github repository over to PYTHONPATH resolved the conflict.

Tensorflow in windows using python pip

Installed python 3.5.2 and also tensorflow using pip command but getting error while importing tensorflow package.
Used command as import tensorflow as tf to import tensorflow. But got error as;
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named 'tensorflow'
How can I rectify this error?
Can I get answer for this as soon as possible..
Are you running on a IDE or ipython or Jupyter?
If yes, it's likely the IDE is using a different python such as virtualenv. It's possible there are multiple pythons installed in your system.
Open cmd and try the following
$ where python
$ python -c "import tensorflow"
Make sure the path you get is same as the installation path.
If there is still an error, compare with this path
$ where pip
It's possible your system is using a different python path if there are multiple python.

Categories