Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DOC: instructions on installing matplotlib for dev#7229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tacaswell merged 4 commits intomatplotlib:masterfromNelleV:eyurstev_DOC_development
Oct 12, 2016
Merged

DOC: instructions on installing matplotlib for dev#7229

tacaswell merged 4 commits intomatplotlib:masterfromNelleV:eyurstev_DOC_development
Oct 12, 2016

Conversation

NelleV
Copy link
Member

This PR supersedes#3961 andfixes#3959

It improves the documentation on installing matplotlib.

(Note that this is a documentation fix - we should probably consider at some point converting matplotlib's code organisation to a more standard python project organization to fix a number of issues contributors regularly run into)

@NelleVNelleV changed the titleDOC: instructions on installing matplotlib for dev[MRG] DOC: instructions on installing matplotlib for devOct 7, 2016

::

python setup.py develop
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We should probably move topip install -v -e . as Nathaniel advocates?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can you point me towards that discussing? I missed it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Most of my discussions with@njsmith about this have been in person.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do you mind explain the logic? It is not a standard way to setup a work environment and the command is unclear and confusing (considering the main use of pip is to download and install from pypi, not local source code).
I've just checked quickly (numpy, scipy, sklearn, etc) and none suggest doing so.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

pip install -e just callssetup.py develop, so it doesn't matter much in practice right now. But the general movement is thatsetup.py is being deprecated and should always be called throughpip, because in the hopefully-not-too-distant futurepip will know how to invoke non-distutils-based build systems.

As a side note I hesitate to recommendsetup.py developorpip install -e because they kinda inherently screw up your virtualenv (you end up with skew between what pip thinks is installed, what python files you actually have installed, and what compiled files you have installed), but these kinds of installs are really popular anyway so I guess this is a losing battle...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

you end up with skew between what pip thinks is installed, what python files you actually have installed, and what compiled files you have installed

What do you mean? An editable install only places a*.egg-link intosite-packages, and that's all that it knows is installed, which seems to be fully consistent.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@QuLogic: Try e.g. checking out the matplotlib 1.5 branch, doing an editable install, and then after that switch to the master branch for more hacking:git checkout master. Now pip thinks your virtualenv has 1.5 (check out the metadata files in the .egg-info directory -- these only get regenerated if you re-do the editable install), but it actually has a mix of master's .py files and 1.5's extension modules. Rebuild the extension modules alone, and now you have a consistent installation of master (2.x) but pip still thinks it's 1.5. Then pip install some package that depends onmatplotlib (>=2.0) and pip will freak out and try to uninstall your dev version, because it isn't good enough, even though it is, etc. You can make it work, but it's intrinsically flaky and you have to be constantly aware of all the weird pitfalls.

@NelleV:

I used to reinstall matplotlib every time, but it has become a pain now that the git hash is appended to the version.

I assume you're referring to the thing where pip refuses to install "matplotlib 2.1.dev1+git123" if you already have "matplotlib 2.1.dev1+git456"? Yeah :-(. This is an incredibly frustrating bug that will eventually be fixed :-(. (The pip maintainers at least have finally come around to consensus that it is a bug that needs fixing, but unfortunately the patch got tangled up in the bikeshed around fixingpip install -U and is temporarily stalled out.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

but it actually has a mix of master's .py files and 1.5's extension modules.

Yes, it fails to load then, and as noted in another PR, you need to re-install to update modules whose source files have changed.

Rebuild the extension modules alone

How would youonly rebuild the modules? Withsetup.py build_ext? But then you've side-stepped pip anyway.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@QuLogic: I'm not saying you can't make it work if you do the right thing. But in general the only wholly reliable way to make it work is to re-run the editable install after every time you change the source; then there are a bunch of special cases where it also works. If you're willing to pay the cognitive overhead to learn and keep track of all those special cases, that's cool, I'm not going to stop you :-). I'm just explaining why I hesitate to recommend it. If you don't want to keep track of that stuff and want to be confident things work reliably, then you'll be re-running the install after every edit so you might as well use a regular install instead of an editable install and avoid the traps entirely :-). (Modulo hopefully-fixed-soon issue@NelleV points to wherepip install . often fails for no good reason whenpip install -e . succeeds.)

(You can also imagine in-between things, like a script that continuously runspip install . every time you change a file.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

A vast majority of the work that needs to be done on mpl is in the pure-python layers, so a source install can be very convenient.

@tacaswelltacaswell added this to the2.0.1 (next bug fix release) milestoneOct 8, 2016

This installs matplotlib for development (i.e., builds everything and places the
symbolic links back to the source code). Note that this command has to be
called everytime a `c` file is changed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Add a note here that make clear changing branchesis changing the c-code?

symbolic links back to the source code). Note that this command has to be
called everytime a `c` file is changed.

You may want to consider setting up a `virtual environment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Make this stronger?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I made it slightly stronger.
If I recall correctly, matplotlib and virtualenv don't play well together, and I've ran in so much problems with matplotlib and conda that I gave up installing any packages from conda recently.

* more stress on setting up virtual environments* underlined the fact that changing branches may affect c code
@NelleV
Copy link
MemberAuthor

All comments have been addressed.

@tacaswell
Copy link
Member

This has conflicts with#7236 ?

@tacaswelltacaswell changed the title[MRG] DOC: instructions on installing matplotlib for dev[MRG+1] DOC: instructions on installing matplotlib for devOct 11, 2016
@tacaswell
Copy link
Member

I am 50/50 on renaming the rst files (as with the other issue) to avoid breaking bookmarks, but if anyone wants to defend the renames I will yield.

@NelleV
Copy link
MemberAuthor

@tacaswell yes, it has conficts with the PR. I'll rebase the other one with those changes once it is merged.

@tacaswelltacaswell merged commit480bf6c intomatplotlib:masterOct 12, 2016
tacaswell added a commit that referenced this pull requestOct 12, 2016
DOC: instructions on installing matplotlib for dev
@tacaswell
Copy link
Member

backported to v2.x as330e683

Thanks@NelleV !

@QuLogicQuLogic changed the title[MRG+1] DOC: instructions on installing matplotlib for devDOC: instructions on installing matplotlib for devOct 15, 2016
@NelleVNelleV deleted the eyurstev_DOC_development branchOctober 21, 2016 23:17
@QuLogicQuLogic modified the milestones:2.0.1 (next bug fix release),2.0 (style change major release)Dec 7, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic left review comments

@njsmithnjsmithnjsmith left review comments

@tacaswelltacaswelltacaswell approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v2.0.0
Development

Successfully merging this pull request may close these issues.

setting up matplotlib for development
6 participants
@NelleV@tacaswell@QuLogic@njsmith@mdboom@eyurtsev

[8]ページ先頭

©2009-2025 Movatter.jp