I tried to install a python package using setup.py but failed.
Any idea about that? I am on Ubuntu 14.04.
pip install setup.py
You just mixed up something.Have a look at pip install usage and Installing Python Modules.
If you want to download a module source distribution and install it, you should unpack the archive into a similarly-named directory: foo-1.0. Additionally, the distribution will contain a setup script setup.py,and then run this command from a terminal:
python setup.py install
You can use pip install if you want to install packages from:
PyPI (and other indexes) using requirement specifiers.
VCS project urls.
Local project directories.
Local or remote source archives.
Hope this helps.
Use the following:
python setup.py install
Try this python setup.py install
Navigate to the folder containing the package
eg: cd /Desktop/packages/foo-1.0/
you can install the package either by
python setup.py install
or by
pip install ./
in Linux use
sudo python3 setup.py install
Related
pip supports installing extra components while installing a Python package from internet, e.g.,
pip install dask[all]
pip install "dask[all] # git+https://github.com/dask/dask"
However, does it support installing extra components when installing from a local Python package? For example, if I have the dask Python package downloaded to local, how can I install it with specific extra components?
I've just figured it out.
pip3 install "dsutil[cv] # file:///home/dclong/dsutil-0.54.1-py3-none-any.whl"
Yes, you can install extras from a local package. If they're defined in the package's setup.py file in the extras_require dictionary, then you can install them with pip install ."[extra1, extra2]". For example, if you have the following in your setup.py:
extras_require={
'docs': ["sphinx>=1.6", "sphinx_rtd_theme>=0.2.4", "sphinx-click"],
'dev': ["pre-commit>=2.10.0"]
},
you can install the docs and dev extras with pip install ".[docs, dev]" when you're in the directory containing setup.py (you'd use the path to the directory containing setup.py in the place of . otherwise).
I need to install a module (scikits.audiolab)
I have tried to do this from terminal however I did not succeed.
I have downloaded the files from https://pypi.org/project/scikits.audiolab/#files
How do I install the package from these download files?
Thanks
to install that package simply open your terminal/cmd and type
pip install scikits.audiolab
if pip install scikits.audiolab is not working...you should be able to:
navigate to the package folder and run
python setup.py install
I downloaded the newest Cython release from https://pypi.python.org/pypi/Cython/#downloads. I'm working in Python 3.5.1 on a Mac so I downloaded
Cython-0.26.1-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
I unzipped it and entered the /Cython directory, but there is no setup.py in the directory. When I try to run python3 setup.py install anyway I get the following error:
/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/Resources/Python.app/Contents/MacOS/Python: can't open file 'setup.py': [Errno 2] No such file or directory
It doesn't seem to be looking in the /Cython directory I am in, but there is also no setup.py in that directory.
Not sure what's going on, I can't seem to find anyone else having this issue.
I've install python3 using homebrew.
The file you downloaded is a wheel file that should be installed using pip. The wheel file does not include the setup.py script which is required to build the package but is not used when installing wheels. First check you are using correct pip command (you need one for python 3.5), this is usually pip3.5 or pip3 command:
$ pip3 -V
pip 9.0.1 from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (python 3.5)
To install cython from the downloaded wheel, issue
$ pip3 install path/to/downloaded.whl
Or simply issue
$ pip3 install cython
as pip will download the latest package wheel for you. Since you installed python 3.5 via Homebrew, you probably have to switch to the user you use to install packages with Homebrew or the installation with pip will fail.
Note that, although suggested in the comments, it is not advised to install cython package via brew install:
$ brew info cython
...
==> Caveats
This formula is keg-only, which means it was not symlinked into
/usr/local,
because this formula is mainly used internally by other formulae.
Users are advised to use `pip` to install cython.
I want to install some python's library in some Virtualenv but don't want to use pip or easy_install.
Is it possible to install it by building the source?
Following command should work with activated python environment:
$VIRTUAL_ENV/bin/python setup.py install
I'm trying to install via pip some libraries but I'm having some problems.
When I try to install some of them I require for my project I get this message:
$ sudo pip install dj-database-url==0.2.0
Downloading/unpacking dj-database-url==0.2.0
Downloading dj-database-url-0.2.0.tar.gz
Cleaning up...
setuptools must be installed to install from a source distribution
It also happens when trying to install distribute==0.6.24
Any ideas?
Download ez_setup.py module from https://pypi.python.org/pypi/setuptools
Open a Terminal.
cd to the directory where you put the ez_setup.py.
Type python ez_setup.py and run it.
You should have it then.
After a pip install command I was getting the same error as you ("setuptools must be installed to install from a source distribution"). Since I couldn't find a solution, it was a lot faster to reinstall the virtual environment where python was running from.
If you're using virtualenvwrapper this is very easy. First you remove your problematic virtual environment (let's say it is called "venv") with:
rmvirtualenv venv
Then you setup a new one with the same name:
mkvirtualenv venv
And finally you install all your packages, including the one you had problems with:
pip install dj-database-url