How to add a local module to my anaconda path - python

I have a module in my local directory ~/mglearn. How can I add it to my anaconda search path? I did the following but it doesn't work:
In [9]: sys.path.append("/home/abigail/mglearn")
In [10]: import mglearn
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-10-e19748f92cd9> in <module>()
----> 1 import mglearn
ImportError: No module named 'mglearn'

I believe you are referencing the mglearn library from the book Introduction to Machine Learning with Python. If that’s the case the library is available regularly through pip. You can use pip install mglean to add it to your anaconda search path.

Related

No module named 'clean-text' after installing it with Conda

I am trying to use the clean-text package.
For installation I used conda install -n nlp -c conda-forge clean-text, where nlp is my virtual environment name. When I run from cleantext import clean using nlp environment, I get:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
C:\Users\SZXFL9~1\AppData\Local\Temp/ipykernel_16796/1988090573.py in <module>
----> 1 from cleantext import clean
ModuleNotFoundError: No module named 'cleantext'
Other imports like pandas etc. work using this virtual environment, but I installed them via the conda GUI. However, also clean-text is displayed in the GUI, so it must be installed.
How can that problem be solved?

can't import spacy in jupyter notebook

i'm using anaconda environment, i've installed SpaCy lib, when i import this lib in terminal (spacy) it works with no error.
but when i use jupyter notebook in the same environemnt does'nt work, and shows this error:
***---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-76a01d9c502b> in <module>
----> 1 import spacy
ModuleNotFoundError: No module named 'spacy'***
can anyone help with this error!

Importgraph lab hello world error

After installing GraphLab in my PC which is running Ubuntu 14.04, I have just encountered the following error in my first hello world program:
import graphlab
The Error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-5-784beace7f26> in <module>()
----> 1 import graphlab
ImportError: No module named graphlab
What is the reason for this and how the error could be solved?
The usual reason for this type of error is that your package is installed somewhere other than on the default path that Python is searching. Check
print sys.path
to see whether the location of your graphlab module is present. I'm guessing that it isn't, in which case you will need to append it:
sys.path.append('path/to/graphlab')
If that works you can then add that location to your PYTHONPATH for future use.
Did you install graphlab on your computer or did you install the graphlab python module? You might need to install the graphlab module if you only installed it on your computer.
Looks like this link here has the information that you need to install graphlab with pip.

ImportError: No module named caffe

I am trying to run Google Research's DeepDream code on a mac running OSx 10.9.5.
There are a few dependencies that I had to install. I am using the Anaconda distribution of python and I made sure that I have all the packages required.
The hardest thing was to install Caffe. I have ATLAS installed using fink. Then I have compiled caffe and pycaffe. When I ran 'make runtest' all tests passed. I also ran 'make distribute'.
When I run the notebook released from Google, I get the following error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-8200bcb1df23> in <module>()
7 from google.protobuf import text_format
8
----> 9 import caffe
10
11 def showarray(a, fmt='jpeg'):
ImportError: No module named caffe
How can this be? What can I try to do to fix it?

FLANN Python Bindings Mac OS X

I've installed FLANN with the following command:
brew install flann --enable-python
But I cannot import the module from within Python:
In [4]: import pyflann
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-4-b6d4c333a325> in <module>()
----> 1 import pyflann
ImportError: No module named pyflann
Both flann and pyflann don't work. It would also be nice if I could make this module available within a virtualenv as well.
Help would be much appreciated, thank you.
I got it! I looked in here /usr/local/Cellar/flann/1.8.4/share/flann/python and saw a setup.py file. I enabled my virtualenv and then ran python setup.py install. It now works!

Categories