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 😄
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.)
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.)
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.
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.
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".
@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?
@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?
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!
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
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
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.
Activity
tacaswell commented on Dec 19, 2022
These were issues I observed people having at the pydata global sprints, 🐑 it took me this long to write them up.
timhoffm commented on Dec 19, 2022
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 commented on Dec 19, 2022
I do not remember what version of Python they reported using....
oscargus commented on Dec 22, 2022
There are wheels on pypi but not on conda/conda-forge.
dstansby commented on Dec 22, 2022
I don't have a windows box to try, but perhaps using mamba instead of conda would speed things up?
oscargus commented on Dec 22, 2022
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 commented on 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 commented on Dec 22, 2022
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 commented on Dec 22, 2022
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 commented on Dec 22, 2022
That's what I thought would happen, but after building I can import pybind11 and setuptools_scm. But maybe I am missing something?
oscargus commented on Dec 27, 2022
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 commented on Jan 4, 2023
Not sure if anyone is working on this, if not, I will take a look
melissawm commented on Jan 4, 2023
@hasanrashid that would be great, feel free to ping if you need any assistance! 😄
ashusnapx commented on Feb 11, 2023
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 commented on Feb 21, 2023
Can you provide me a good resource to follow for making a virtual environment in python?
hasanrashid commented on Feb 22, 2023
@ashusnapx Thank you for the pointer. Here is where I am with this:
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 commented on Mar 17, 2023
@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 commented on Apr 2, 2023
Can I have my hands on this issue, I am new to open source and wanted to contribute
tacaswell commented on Apr 2, 2023
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 commented on Apr 2, 2023
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 commented on Apr 2, 2023
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 commented on Apr 2, 2023
@nitin-pandita we have guidance for contributors here:
https://matplotlib.org/devdocs/devel/contributing.html
turnipseason commented on May 2, 2023
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 commented on May 2, 2023
That makes 3 successes, so I think we can close this.