Can anyone tell me how I can install the numpy module for python. Since I have so little knowledge of installing modules, I would also like to know in what directory I'll have to store it.
You could use pip. I suggest you do a quick google search on pip, but basically its running pip install numpyfrom the command line or terminal.
Related
I am beginner for python and get stack at how python organize its code.
For example:
https://github.com/HIPS/neural-fingerprint/blob/master/examples/regression.py
In the regession.py, it will import the neuralfingerprint directory. When I run the regession.py in anaconda python, it says that the neuralfingerprint doesn't exist. I need to copy neuralfingerprint again to make sure neuralfingerprint and regession.py are in the same folder.
Any convient way? or why the author put regession.py and neuralfingerprint put them in different folder?
Thanks.
That is because what you have linked is a python library, and should be installed before you can properly use it. From the command line, run python setup.py from within the folder, or just run pip install git+https://github.com/HIPS/neural-fingerprint.git on the command line. This will install the library, and python will be able to find the correct files.
For this library, however, some other libraries are needed that are not installed automatically.
To install scipy: pip install scipy or conda install scipy with anaconda
For RDKit: it seems like you have to follow this
From what I've read, it sounds like the issue might be that the module isn't in the same directory as my script. Is that the case? If so, how do I find the module and move it to the correct location?
Edit
In case it's relevant - I installed docx using easy_install, not pip.
I use pycharm, created a project, you can choose which interpreter you want to use tu run your program, a common problem is having 2 interpreters and installing docx in one, and launching with the other interpreter. Also check the Lib included the packages of docx.
Library
pip show docx
This will show you where it is installed. However, if you're using python3 then
pip install python-docx
might be the one you need.
Please install python-docx.
Then you import docx (not python-docx)
I try a python code for signature recognition, and there is an import ffnet module (from ffnet import mlgraph, ffnet), but I got an error when I run it.
The error is:
ModuleNotFoundError: No module named 'ffnet'
I have install the module, but still got that error
Help me to fix this :)
You need to make sure that it is correctly installed. The error message means directly "You haven't installed it properly".
Depending on what Python version you're using, you should have a package manager called pip that takes charge of installing and uninstalling modules. Try:
pip2 install ffnet if you have Python 2.
pip3 install ffnet if you have Python 3.
Alternatively, you may have installed Python using Anaconda. In this case, use conda install ffnet. In all cases, run the proposed commands in a terminal.
However, it would be quite useful to have more details about your problem (what OS do you have, how and where did you install Python, what version do you have).
There is great chance that the pip (i suppose you use pip for installation, the idea is identical) you use to install ffnet is not correspond to the python you are using. Maybe a virtualenv is running, or you using python 2 but ffnet is installed with pip3
My suggestion:
- Run which pip. Run which python. Compare the results if anything seem wrong (python2 pip3 for example). Try to run python2 and pip2 instead of python and pip
- If the above suggestion doesn't work, you should try to recheck your PATH: Find the pip correspond to your current python (usually within the same dir) and export PATH=/path/to/THAT/pip/:$PATH
- If the problem still persist, I suppose your pip file's first line (for specifying its corresponding python path) has been modified without your awareness. You will have to manually edit it to something like #!/usr/bin/python3
Hope this help!
I am trying to pip install importlib with python 3.6, but I get an Import Error saying: 'NO Module named "importlib.util"'. This also comes up when I try to pip install imagescanner, which is my real intention. Building an App that connects to Image Scanner Devices, but that's another problem...
Thanks for any help!
importlib is builtin with Python 3 (at least for me), you can import it directly without installing anything.
The error from pip install is possibly due to importlib is builtin and there's no distribution that's publicly available.
If your Python is from the last 5 years or so, then importlib is builtin. It is available as an external PyPI package for anyone using a much older Python that doesn't have it. You shouldn't be pip installing it, and modules that you are installing also shouldn't be pip installing it. That's a bug in the package you are trying to install, or one of the modules that it installs.
I'm trying to install openpyxl and I haven't the clue how to install it. I have my C:\Python27...but what directory do I put it in? FYI, I'm a complete noob to modules and what not...I appreciate your help.
I have put in the lib and libs directory of python and try installing it to no avail. Here is a link to the site I got my download... http://pythonhosted.org/openpyxl/.
Basically, I extracted the file and move it to the lib directory. However, I cannot import it.
There is a setup.py script provided. Typically you run:
python setup.py install
From the directory were you've downloaded the library, and it gets installed automatically.
Consider also more convenient tools that manage installing Python libraries in general like pip or easy_install mentioned in other answers and comments.
It's even easier when the package is on the Python Package Index (PyPI). Just install pip and use it to download and install the package and all its dependencies.
https://pypi.python.org/pypi/pip