A question about pip install vs python setup.py install - python

What is the main difference in installing a python package by pip install and python setup.py install using the file from GitHub repository?
From what I understand right now, I kinda have the feeling that using the second option you will install the repo in some sort of developer mode where you can do changes by directly operating in the files cloned by git repo. Is this correct? I would like to find out a proper explanation of this.

Related

Python Package Download in offline environment :( ('typing_extensions-4.0.1')

I'm trying to run a Django Application in an offline internal network environment.
I have a problem in the process of downloading requirements for this.
Currently, I'm installing Python packages using the 'setup.py install' command.
However, there is no setup.py file in the 'typing_extensions-4.0.1' package, so it's impossible to download the package. I want to ask for advice on how to solve it.
For your information, 'conda', 'pip' conmmands are not available.
In case you weren't aware, it is possible to use pip in an offline install too.
pip install --no-deps --no-index some-package.whl
you'll of course need to download the .whl file in some manner first, e.g.:
pip wheel --wheel-dir /tmp some-package==1.2.3
Hi Welcome to Stackoverflow,
this might be a little of the wall, looking at the repo https://github.com/python/typing/,
clone the repo to your computer git clone git#github.com:python/typing.git
take, `src/typing_extensions.py and copy it into your project
import and see if it works.
If you run into issues let me know and have a play around

How to install ZhuSuan a library for bayesian deep learning?

I want to install ZhuSuan a library for bayesian deep learning.The documentation says that:
ZhuSuan is still under development. Before the first stable release (1.0), please clone the GitHub repository and run:
pip install .
So I copied the link and run:
pip install https://github.com/thu-ml/zhusuan.git
However, I can't install it and during downloading I get an error:
can't unpack the file
You are trying to install a GitHub repository as a pip package, it will not work. You must clone the GitHub repository first (using SourceTree or any other tool).
Once you have cloned it (that means you downloaded it to your computer, using Git), go to that directory in your computer and run pip install . from that directory.

Download Python library from Github with Anaconda

I am looking to download a Python library (specifically this one) from GitHub.
I had already downloaded it using pip install espnff but it appears changes have been made to it and the only way to get the updated version is through GitHub. I should also mention that I use Python with the Anaconda distribution, if that affects anything.
How do I download and update what I already have?
First, you should make sure that pip actually uses you anaconda python distribution, and not e.g. the one that comes as default on your OS. You can use which pip to do that.
After that, it is as easy as
pip install espnff --upgrade
If the latest changes have not yet been made available on pip, you could also try to install it manually from source. Taken from the repository you linked:
git clone https://github.com/rbarton65/espnff
cd espnff
python setup.py install
To make sure that you're installing the latest version available, you should use git pull to fetch and merge the latest changes before installing.
On some occasions, you might also have to delete the existing build directory first, or use
python setup.py build --force
python setup.py install

In Python, how do you "install the repository version?"

I've been trying out the examples from the IMDBPY website. They don't work. As a fix someone said "you have to install the repository version, without using easy_install or pip, until we've packaged a newer version."
I'm very new to Python. I'm not even sure what the repository version is, let alone how to install it. Could someone please explain? If it matters, I'm using Python 2.7.
"Someone" may have misled you slightly by saying:
... without using easy_install or pip
You may still use pip when installing the repository version. They probably meant to say that you can not install the current version from PyPI yet.
In your shell:
$ git clone https://github.com/alberanid/imdbpy.git
Then cd into the imdbpy directory (the directory where you have the setup.py file contained). Optionally create/activate a virtual environment, and then:
$ pip install .
Repository version means you will need to checkout their repository on Github or other Subversion system they are hosting the code on. For git, that means cloning the repository to your local machine.
Like so: git clone https://github.com/alberanid/imdbpy

Scikit-learn tutorial documentation location

I have scikit-learn 0.16.1 installed on Ubuntu 14.04 and am working through the tutorial. SKL was installed with all default configuration. The tutorial states
The source of this tutorial can be found within your scikit-learn folder:
scikit-learn/doc/tutorial/text_analytics/
I've used find on my entire drive and there is no "tutorial" folder. Not anywhere. Anybody know where these files are really installed?
Finding the package contents
Where the packages are installed depends on how you installed scikit-learn
If you used Ubuntu's package system via
sudo apt-get install python-sklearn python-sklearn-doc
(you often need the doc package to get the accompanying documentation), then the tutorial is simply missing. The doc/-folder it is not contained in the python-sklearn-doc-package. See the bug report.
You can find out the contents of the package via
dpkg-query --listfiles python-sklearn-doc
If you used the Python Package Index to install it via
pip install --user --install-option="--prefix=" -U scikit-learn
, then the installation should be at $HOME/.local/lib/python2.7/site-packages/sklearn. (as also of pip show -f scikit-learn) But a
find . | grep -i tutorial
did not find any tutorial/-folder.
If you installed it from source, consider reinstalling via pip, as the warning states that
Warning
Packages installed with the python setup.py install command cannot be
uninstalled nor upgraded by pip later. To properly uninstall
scikit-learn in that case it is necessary to delete the sklearn folder
from your Python site-packages directory.
Solution
A solution would be to use the source. Either download the master file or do it via git:
git clone https://github.com/scikit-learn/scikit-learn.git
The git archive is more than 60 MiB, so you might want to prefer the master zip.

Categories