I am on google-cloud-ml notebook. Trying to install pandas_ml in order to import it.
I read https://cloud.google.com/ml-engine/docs/notebooks/dependencies tried both options (terminal and a separate installation notebook). None of those solutions work for me
#either
pip install pandas_ml #terminal
#or
!pip install pandas_ml #notebook
Solved!
since I'm using Python 3.5 I had to use pip3 instead of pip
!pip will install your packages on the system level and not in your notebook kernel. Try this instead:
import sys
!{sys.executable} -m pip3 install pandas_ml
Eventually, Google MLE notebooks will support %pip.
More information can be found on Jake VanderPlas's blog: Installing Python Packages from a Jupyter Notebook.
Related
python 3.8.12 installed by pyevn seems working as expected, but numpy installed using pip cannot be imported.
pip --list ran in Jupiter notebook shows the package has been installed already.
So as per the path you stated in your comment (reply), execute this command:
/usr/local/opt/python#3.9/bin/python3.9 -m pip install pandas
When I try using Jupyter notebook, kernel error appears like this
import win32api
ImportError: DLL load failed while importing win32api:
After connecting vs code to jupyter notebook, error appears.
I've already tried
conda install pywin32
and copied the two files from [installation directory of Anaconda]\Lib\site-packages\pywin32_system32 to C:\Windows\System32
but it didn't work.
how to fix?
Try installing it using pip, it can solve your problem here
pip install --upgrade pywin32==225
Or this, if you don't have the package already
pip install pywin32==225
After activating the env where the above is causing issue uninstall win32api (if it is installed):
pip uninstall pywin32
Then use pip to install pywin32:
pip install pywin32
Jupyter should work afterward. The solution is proposed here by ValentinVerschinin
Are you using Python 3.8? It seems to be a Python 3.8 specific problem.
Can you try to install the pywin32==225?
You can refer to this page.
Installing the relevant binary from github worked for me
I have installed tensorflow in a virtual environment and can import Tensorflow in jupyter notebook or terminal. I am now learning to use VScode, so I try to launch it in the jupyter notebook within the VScode, but Tensorflow cannot be imported.
It shows ModuleNotFoundError: No module named 'tensorflow', but I have installed it and it can be used in the terminal or jupyternotebook.
I also tried to define the path of the python interpreter, but it did not work. Could someone help me out? Tons of thanks.
Try:
This works for me.
pip --version
python -m pip install --upgrade pip
pip3 install tensorflow==2.0.0
pip --version
python -m pip install --upgrade pip
pip3 install tensorflow==2.8.0
Worked for me.
I have installed Librosa using this command "pip install librosa" and it is successfully installed . But when I execute "import librosa" in Jupyter Notebook it gives error. Can anyone help ?
I've run into this problem a couple of times. You can try to use pip directly from your notebook:
# Install a pip package in the current Jupyter kernel
import sys
!{sys.executable} -m pip install <package>
Read this. It helped me a lot.
I start my jupyter notebook with python2 as:
jupyter notebook nameofnotebook
Then I want to import library like this:
import scipy
But I have an error telling that there is no such library.
So I execute in the notebook cell:
!pip2 install scipy
Requirement already satisfied: scipy in /usr/local/lib/python2.7/dist-packages
How to install package correctly to jupyter kernel?
#håken-lid is right. There are probably several versions of python. So to install your package to python where your jupyter is located:
$ which jupyter
/YOURPATH/bin/jupyter
$ /YOURPATH/bin/pip install scipy
This will do for Python 2.x
For Python 3.x pip3 will be in /YOURPATH/bin instead of single pip
You can run pip from python.
import pip
pip.main(['install', 'scipy'])
If you are using the system python, and running jupyter in a process that doesn't have permission to install global packages, you can use the --user flag to install a module for the current user only.
pip.main(['install', '--user', 'scipy'])