Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Doc]: windows install instructions do not work #24779

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tacaswell opened this issue Dec 19, 2022 · 24 comments
Closed

[Doc]: windows install instructions do not work #24779

tacaswell opened this issue Dec 19, 2022 · 24 comments
Labels
Documentation Good first issue Open a pull request against these issues if there are no active ones!
Milestone

Comments

@tacaswell
Copy link
Member

Documentation Link

https://matplotlib.org/devdocs/devel/development_setup.html#create-a-dedicated-environment

Problem

The conda instructions do not work on windows:

  • it is very slow
  • fails on lxml + pikepdf installation

The venv method does not include in information about how to install all of the dev dependencies

Suggested improvement

Possible options for conda:

  • find a way to get pikepdf to install on windows
  • remove those entries from environment.yml

Possible solution for venv:

  • document pip install -r requirements/dev/dev-requirements.txt
@tacaswell tacaswell added Documentation Good first issue Open a pull request against these issues if there are no active ones! labels Dec 19, 2022
@tacaswell tacaswell added this to the v3.7.0 milestone Dec 19, 2022
@tacaswell
Copy link
Member Author

These were issues I observed people having at the pydata global sprints, 🐑 it took me this long to write them up.

@timhoffm
Copy link
Member

timhoffm commented Dec 19, 2022

fails on lxml + pikepdf installation

Is that pikepdf/pikepdf#410? I haven't tested, but it seems there are wheels available since a couple of days. - Some problems solve themselves if you wait long enough 😄

Other environment.yml updates: #24780.

We may consider having an infrequent CI run that builds based on environment.yml to make sure it's still working.

@tacaswell
Copy link
Member Author

I do not remember what version of Python they reported using....

@oscargus
Copy link
Member

There are wheels on pypi but not on conda/conda-forge.

@dstansby
Copy link
Member

dstansby commented Dec 22, 2022

I don't have a windows box to try, but perhaps using mamba instead of conda would speed things up?

@oscargus
Copy link
Member

Thinking twice, pikepdf is installed from pip, so it was probably just that there were no Windows wheels available at that time. (Still, there are no Windows packages on conda, but there are Linux packages, so one can think of installing from pip on Windows and conda otherwise/on LInux.)

mamba is mentioned it seems.

@oscargus
Copy link
Member

oscargus commented Dec 22, 2022

I just followed the instructions and it worked well. (Windows 11) Edit: I should mention that I have some things already installed via pip, but pikepdf and lxml were downloaded and installed, as I did not run Python 3.11 earlier as default.)

However, something pulls in matplotlib-base as a dependency (I think via matplotlib-inline which I think comes from ipython), which is maybe not a big deal but would be nice to avoid if possible.

Also, when installing, pip pulls in another version of numpy, certifi, pybind11, setuptools_scm, and packaging. This may be OK, but I think that these are actually installed "properly", not just as part of the build, so maybe they should be in environment as well? (numpy should of course be numpy_lowest_supported_version or whatever the name is.)

@tacaswell
Copy link
Member Author

Also, when installing, pip pulls in another version of numpy, certifi, pybind11, setuptools_scm, and packaging.

That maybe the isolated build environment doing it's job. I'm torn if we should add --no-build-isolation to our install instructions.

@ianthomas23
Copy link
Member

I am arriving late to this, so I may not have the full picture.

There is no need for pybind11 to be in the environment.yml. With build isolation, which is what happens unless you explicitly disable it, pybind11 and friends are installed in the temporary isolated build environment to build the matplotlib wheel and that build environment is then discarded. It never needs to be in the conda environment.

I have just tried the latest environment.yml without pybind11 under Windows 10 and it works fine. Tediously slow but works. Use of mamba should indeed speed this up.

@oscargus
Copy link
Member

That's what I thought would happen, but after building I can import pybind11 and setuptools_scm. But maybe I am missing something?

@oscargus
Copy link
Member

Another thing here is that maybe one would like to point out a bit clearer how to get the Windows build dependencies. It is in the next section, but can be a bit confusing, I guess, if one follows it step by step. (On Linux and, I assume, Mac there is usually some sort of compiler installed.) Taking that if one needs help to install a compiler, it is probably the easiest to install the Visual Studio build environment (or whatever it is called), one may think of directly linking to the download page for that.

@hasanrashid
Copy link
Contributor

Not sure if anyone is working on this, if not, I will take a look

@melissawm
Copy link
Member

@hasanrashid that would be great, feel free to ping if you need any assistance! 😄

@oscargus oscargus modified the milestones: v3.7.0, v3.8.0 Jan 12, 2023
@ashusnapx
Copy link

If you're having trouble setting up Matplotlib for development on Windows, there are a few steps you can try to troubleshoot the issue:

Make sure you have the correct dependencies installed: Before installing Matplotlib, make sure you have the necessary dependencies, such as Python, NumPy, and a supported version of the Microsoft Visual C++ Redistributable for Visual Studio.

Use a virtual environment: It's recommended to install Matplotlib in a virtual environment to avoid conflicts with other Python packages on your system.

Check the file paths: Ensure that the file paths in the activation script match the actual file paths on your system. For example, if your virtual environment is located in a different folder than the one specified in the activation script, replace the file path in the script with the correct path to your virtual environment.

Try using a different terminal: If the activation script is not working in the Command Prompt, try using a different terminal, such as the Windows PowerShell, and run the appropriate activation script for that terminal.

Run the activation script as an administrator: If you're still having trouble activating the virtual environment, try right-clicking on the activation script and selecting "Run as administrator".

@sohamds1
Copy link

Can you provide me a good resource to follow for making a virtual environment in python?

@hasanrashid
Copy link
Contributor

@ashusnapx Thank you for the pointer. Here is where I am with this:

  • I have used conda to build matplotlib with both python 3.11, 3.10 and 3.9.
  • All of them succeeded, but python 3.9 took about 35 minutes to build- other 2 were faster
  • I used virtualenv, and it succeeded as well, and appeared faster than conda

So, what would be the best way to solve this? remove pikepdf from environment.yml, or update documentation with this caveat + the venv instruction of using pip?

@hasanrashid
Copy link
Contributor

@ashusnapx @melissawm Wanted to see if this still needed help. For me pikepdf never failed. I listed the behaviour I saw above. Do we still go ahead with removing the entries from the environment yml?

@nitin-pandita
Copy link

Can I have my hands on this issue, I am new to open source and wanted to contribute

@tacaswell
Copy link
Member Author

So far we have 2 reports (@hasanrashid and @oscargus ) that things work as expected and hence no action is needed.

@nitin-pandita I think the work we need here is (assuming you have a windows machine) is to verify that the instructions work for you and if they do we can close this issue!

@nitin-pandita
Copy link

No problem @tacaswell , Please let me know if there is some other good first issue I can contribute to, as I mentioned early I'm new to Open source, and I would love to work under your guidance and support. Thank you @tacaswell

@nitin-pandita
Copy link

So far we have 2 reports (@hasanrashid and @oscargus ) that things work as expected and hence no action is needed.

@nitin-pandita I think the work we need here is (assuming you have a windows machine) is to verify that the instructions work for you and if they do we can close this issue!

Can you please suggest to me some good first issues as a beginner? I really wanted to get indulge in community work, I'm more into web Scrapping and Machine Learning

@rcomer
Copy link
Member

rcomer commented Apr 2, 2023

@nitin-pandita we have guidance for contributors here:
https://matplotlib.org/devdocs/devel/contributing.html

@turnipseason
Copy link
Contributor

Hi, @tacaswell! I followed the windows instructions for both venv and conda (python 3.11.3) and there were no problems with either. Conda did take a bit longer though (~25 minutes as opposed to ~15 with venv).
@nitin-pandita didn't seem to respond so I wondered if this issue should be considered closed.

@QuLogic
Copy link
Member

QuLogic commented May 2, 2023

That makes 3 successes, so I think we can close this.

@QuLogic QuLogic closed this as completed May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Good first issue Open a pull request against these issues if there are no active ones!
Projects
None yet
Development

No branches or pull requests