简体   繁体   中英

python - pip: What are the files installed exactly?

I am trying to upgrade a python package called "bokeh", that is containing an "examples" directory in its ditribution files: Here the link to the distribution file: https://pypi.python.org/pypi/bokeh/0.12.10

And here an image showing the content of the tar.gz file: 在此处输入图片说明

I can see the "examples" directory that i am after is present.

However if i pip install --upgrade bokeh , only the directory "bokeh" (the first one in the image) is installed on my machine.

How can i have this "example" directory to be install as well eventually?

It is meant that way because of the sample data size needed for the examples provided. This is from the documentation :

Some of the Bokeh examples rely on sample data that is not included in the Bokeh GitHub repository or released packages, due to their size. Once Bokeh is installed, the sample data can be obtained by executing the following command at a Bash or Windows prompt:

bokeh sampledata

or, run this in your python interpreter:

import bokeh.sampledata
bokeh.sampledata.download()

Normal pip installations are not supposed to be "looked into" by the user. Depending on your system they might end up in

/usr/local/lib/python2.7/site-packages

or

$PYTHON_HOME/lib/python2.7/site-packages

or somewhere entirely else.

Instead you should Git clone the repo (or download the tarball from there) and install the directory (an editable install)

git clone https://github.com/bokeh/bokeh.git
pip install -e bokeh/

that way the library you are using is directly next to the examples you are using:

import bokeh

directly imports the code you just downloaded.

Alternatively you can install bokeh from PyPI and just git clone or download the repository to get the examples. But you should be aware that

import bokeh

doesn't import the library you just downloaded, but the one you installed earlier.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM