I take jupyter notebook with this line in the import :
import import_ipynb
When I run the notebook iI got the error :
ModuleNotFoundError: No module named 'import_ipynb'
I try to install with anaconda :
conda install import_ipynb
or
conda install import-ipynb
But it dont find the package, but with pip I got no problem :
pip install import_ipynb
Any idea with anaconda ?
Thanks !
It looks like that "package" - really, it's just a script - doesn't properly list it's dependencies in setup.py. I also can install it from pip, but it shows it can't load because it references nbformat. Using
conda install nbformat
get's it working for me.
Recommendation
I don't know this package space, but it seems like nbimport is a far more mature solution for such functionality. It is available on Conda Forge (conda install -c conda-forge nbimport) and appears to be quite popular (> 20K downloads).
Related
I use Python and pycharm as a tool.
If you use the pip statement to install the library, you will get an error.
For example, if I want to download the torch (1.6.0) version and type pip install torch==1.6.0,
It says no version.
This is not the end, but some libraries continue to cause strange conflicts and will not be installed.
For example, if you type pip install poro to install the poro library, an unknown error pops up and the installation fails.
I'm not asking for a pororo installation.
My question is, I want to know how to download the library without relying on pycharm.
I want to download it separately from a site like pypi and put the library directly into the virtual environment (conda).
What should I do?
The following worked for me:
First, install mkl using conda:
conda install -c anaconda mkl
Then run this:
conda install -c pytorch pytorch
I'm using conda with Spyder/Python 3.8.8.
I'm trying to install the geopandas package through conda-install, but when running it, I receive no output.
I've input the command conda install -c conda-forge geopandas and let it run for 30 minutes so far, so I doubt it's just a large package or poor connection. I don't know if I'm supposed to be seeing progress updates, but if I am, I'm not.
Any help is appreciated, thanks!
If you are using the base Anaconda environment, then there are packages that are conflicting with geopandas. I suggest you to create new environment for geopandas:
open anaconda command line and run this command to create new environment:
conda create --name gis python==3.8
You can use any version of python you like of course. Then you need to activate it:
conda activate gis
Now you can install geopandas and jupyter lab if you need it (Personally recommend VSCode):
conda install -y -c conda-forge geopandas jupyterlab
enter code here
Use below command to install,
conda install geopandas
or
pip install geopandas
When using pip to install GeoPandas, you need to make sure that all dependencies are installed correctly.
fiona provides binary wheels with the dependencies included for Mac and Linux, but not for Windows.
pyproj, rtree, and shapely provide binary wheels with dependencies included for Mac, Linux, and Windows.
Windows wheels for shapely, fiona, pyproj and rtree can be found at Christopher Gohlke’s website.
Depending on your platform, you might need to compile and install their C dependencies manually. We refer to the individual packages for more details on installing those. Using conda (see above) avoids the need to compile the dependencies yourself.
This solution might not be exactly relevant, but since there is no marked solution, it might help...
I recently ran into a problem installing geopandas as well. Though I did mine through my terminal and I did receive an error message: OSError: could not find or load spatialindex_c-64.dll.
I used: conda install -c conda-forge rtree=0.9.3.
Check out this post for more info.
Currently I am working on voice recognition where I wanted to use Librosa library.
I install librosa with the command on ubuntu:
conda install -c conda-forge librosa
But when I run the code I got the following error:
import librosa
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-9-989066361697> in <module>
----> 1 import librosa
ModuleNotFoundError: No module named 'librosa'
Can anyone tell me how to use librosa?
If you’re using a Python 3.5 environment in conda, you may run into trouble with the numba dependency. This can be avoided by installing from the numba conda channel before installing librosa:
Run this command first in anaconda prompt
conda install -c numba numba
and then
conda install -c conda-forge librosa
I hope this would help you
There are two solutions,
Try to install librosa by system:
*. First open cmd in system and try one of following commands.
pip install librosa
sudo pip install librosa
pip install -u librosa
Or in conda environment:
*. Open appropriate anaconda prompt(according to environment) and try following commands inorder,
First,
conda install -c numba numba
Then,
conda install -c conda-forge librosa
What I did
I had a similar problem. I had to use the following code:
sys.path.append(r"C:{pathtopython}\Lib\site-packages")
Assuming you downloaded librosa to the path above, then the program will be able to find librosa and use it.
Why it Works/Why it Happened
It works because the program is looking in a directory that the package isn't in.
All my other packages were able to be found by my program without using the code above, so I think it's related to the librosa installation.
Do pip install librosa --user and then restart Anaconda.
It did not work for me also and I received the same error. Then I cut and pasted the entire code to a new SPYDER document and it worked. Not sure why it did not work the first time in SPYDER. But try pasting into a new SPYDER file and see what happens.
My OS is Ubuntu, and I've followed the official installation guide to install lightgbm. However, when I import it, this error is raised:
ImportError: No module named lightgbm
How can I solve this?
Do I also need to go to /python-package folder to run setup.py after running those linux commandlines?
I had the same problem, and solved running the installation directly on the notebook
!pip install lightgbm
Besides running those linux command lines. I also need to go to /python-package then run 'python setup.py install'.
conda install -c conda-forge lightgbm solved the problem for me
you need just run in a notebook cell before importing
For Windows users, VC runtime <https://go.microsoft.com/fwlink/?LinkId=746572> is needed if Visual Studio (2015 or 2017) is not installed.
Install wheel <http://pythonwheels.com> via pip install wheel first. After that download the wheel file and install from it:
pip install lightgbm
The following should do the trick:
export PATH=/usr/local/bin/anaconda3/bin${PATH:+:${PATH}}
PYTHONPATH=$PYTHONPATH:/usr/local/bin/anaconda3/lib/python3.6/site-packages
Note that you might need to change the paths if you are using a different Python version.
Thank you for above question and answers, had a similar issue.
Problem:
After successfull install of lightgbm, I was getting the error ImportError: No module named 'lightgbm' (in Jupyter Notebook on Google Cloud's Notebook Instance in AI Platform project).
Issue:
Realized that the install of lightgbm was in Python 2.7 even when the notebook was running in Python 3 (path: './.local/lib/python2.7/site-packages').
Solution:
The error was gone after the Jupyter Notebook was set to run on Python 2 instead of Python 3.
within Jupyter Notebook cell is: try running
import sys
!{sys.executable} -m pip install lightgbm
With python try, from pypi.org, this line
pip install lightgbm
or
pip3 install lightgbm
Also, you can try this one if you use anaconda
conda install lightgbm
I have recently installed Anaconda with Python 3.5 and all the rest. I come from R where I am used to install packages dynamically. I am trying to install a module called scitools through jupyter notebook. I would like to recreate this in jupyter. However, I don't know how to dynamically install packages (if it's possible). I would greatly appreciate your help. Thank you!
EDIT: I am trying to use conda as recommended by the community, but it's not working. I am using mac OSX
Check Jake Vander Plus Blog here to learn how to install a package with pip from Jupyter Notebook.
# Install a pip package in the current Jupyter kernel
import sys
!{sys.executable} -m pip install numpy
So if you have already done the install with anaconda, you may already have the module installed. In that case in your jupyter notebook after you have activated your kernel, you just need to make sure you execute the import statement.
import scitools
If you haven't installed that module yet, you can install it one of two ways. Both work from your command line or terminal.
pip install scitools
or since you have Anaconda
conda install scitools
and that should do it. Your import statement in your notebook when executed should correctly locate and enable the use of that module.
I had the same issue. It turns out if you open an anaconda window, which in Windows is accessible under the Anaconda drop down, it points to the correct location to install (or update) using pip.