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
Related
I'm new to Python. I'm familiar with pip... but how do I install something that pip doesn't know about?
Specifically, this is a Jupyter SQL Magics extension (GitHub link)
How do I install an extension "from scratch"?
Not everything is uploaded to pip and can be installed by it.
This seems to be a python script not extension.
Just download the code and use it as import to your script.
Here is how imports work
Python extensions, modules, library or programs (call them how you like) have setup.py script that makes them install-able. Or if its a program that requires library in order to use it it might have requirements.txt file.
This file is used by pip to install every dependency like so:
pip install -r requirements.txt
you can read more about setup.py here
Can you give more details what are you trying to accomplish?
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
I am trying to install a package named QSTK for a course that I am doing. The course points to an installation package for the 32 bit version, but I have 64 Python installed. I have found a .egg file listed on the Python packages index.
It seems to have an exe for 32 bit, but just the .egg for 64 bit. I downloaded the QSTK-0.2.6-py2.7.egg version and have been trying to install this unsucessfully so far.
Here is what I have tried:
Using easy install (from the C:\Python27\Lib\site-packages
directory):
Python easy_install -Z C:\Users\Prosserc\Downloads\QSTK-0.2.6-py2.7.egg
this has created a QSTK-0.2.6-py2.7.egg directory in my
site-packages directory which I can open and find files in. However,
I have tried to import QSTK from the python shell and get the usual
"No module named..." import error.
I looked for a setup.py file as I have used these to install
packages before, but could not find one.
I have also looked at this thread which gives details of
installing a .egg file without using easy install, but cannot figure
out what changes I would need to make to the script provided as this
is to install a specific package that I already have.
If anyone can help by explaining either how I can install this .egg file correctly or by providing a link to the QSTK modules for python 2.7 64 bit in another format this would be greatly appreciated.
I have managed to install the packages that QSTK is dependant on okay (numpy, scipy, matplotlib, pandas, python-dateutil and scikit-learn).
You should add -m before easy_install
for example:
python -m easy_install C:\Users\Prosserc\Downloads\QSTK-0.2.6-py2.7.egg
How about if you unpack the .egg (it's just a .zip in disguise), then cd into it and run python setup.py install? Will that run fine and will you then be able to import your module?
I'm saying this because if the .egg file does get put under site-packages as appropriate but you're still not able to import, this might be a problem in the code itself.
I have finally found another place to download this from with a package that works: https://pypi.python.org/pypi/QSTK/0.2.6 has a QSTK-0.2.6.tar.gz option to build it from the source code.
Unzipping this (then again once down to the .tar), I could find the setup.py file and install by going to the directory with the setup file and running:
python setup.py install
I tried copying the contents of the .egg folder in the path Lib\site-packages .
It worked and didn't throw any ModuleNotFoundError .
I found pip install qstk works perfectly for 64x 2.7 python at win 7
I'm wondering if there's a way to "install" single-file python modules using pip (i.e. just have pip download the specified version of the file and copy it to site-packages).
I have a Django project that uses several 3rd-party modules which aren't proper distributions (django-thumbs and a couple others) and I want to pip freeze everything so the project can be easily installed elsewhere. I've tried just doing
pip install git+https://github.com/path/to/file.git
(and tried with the -e tag too) but pip complains that there's no setup.py file.
Edit: I should have mentioned - the reason I want to do this is so I can include the required module in a requirements.txt file, to make setting up the project on a new machine or new virtualenv easier.
pip requires a valid setup.py to install a python package. By definition every python package has a setup.py... What you are trying to install isn't a package but rather a single file module... what's wrong with doing something like:
git clone git+https://github.com/path/to/file.git /path/to/python/install/lib
I don't quite understand the logic behind wanting to install something that isn't a package with a package manager...
Ok, so i've downloaded the following library:
http://www.lag.net/paramiko/
and i can't seem to figure out how to install on my local machine:
Mac OS X 10.4.11
To use the package that you got from the web-site: "python setup.py install
"
My advice is to use easy_install instead of downloading packages straight from the project web-site.
To do this, you must first install setuptools.
Then just use the command "easy_install paramiko".
As you use lots of different packages, this ends up saving you lots of hassle.