Skip to content
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

Don't require Microsoft Build Tools on 3.10+ Pythons #2524

Closed
ptsavol opened this issue Jan 26, 2024 · 8 comments · Fixed by #2687
Closed

Don't require Microsoft Build Tools on 3.10+ Pythons #2524

ptsavol opened this issue Jan 26, 2024 · 8 comments · Fixed by #2687
Assignees
Labels
bug Something isn't working

Comments

@ptsavol
Copy link
Member

ptsavol commented Jan 26, 2024

I think the culprit here is the psutil package, which is a dependency of our dependency (not sure which one). It seems that we have locked the psutil version to < 5.9.2 in toolbox. 5.9.1 requires the Microsoft build tools but newer versions of psutil don't. I'll just remove the psutil requirement lock and see what happens.

@ptsavol ptsavol added the bug Something isn't working label Jan 26, 2024
@ptsavol ptsavol self-assigned this Jan 26, 2024
ptsavol added a commit that referenced this issue Jan 26, 2024
…quire Microsoft Build Tools on Python 3.10+

Re #2524
ptsavol added a commit to spine-tools/Spine-Database-API that referenced this issue Jan 30, 2024
@ptsavol
Copy link
Member Author

ptsavol commented Jan 30, 2024

It works! The problem is caused by missing wheels on PyPi for Python 3.10+ which resulted into this error when doing pip install -r requirements.txt:

...
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
...

In our current requirements, there are two packages that do not have wheels on PyPi for Python 3.11: psutil and cx_oracle. Dealing with psutil was easy, because all I had to do was to remove the psutil<5.9.2 limit from toolbox. But cx_oracle does not have wheels for Python 3.11 either. The reason is that the package has been renamed to oracledb in the new 9 version.

@soininen and @manuelma is it Ok if I update spinedb_api's requirements.txt to install oracledb instead of cx_oracle? We don't actually use cx_oracle anywhere so I'm not sure why that even is there but I guess this might affect some user scripts. Or should we just remove cx_oracle from our requirements?

@soininen
Copy link
Contributor

soininen commented Jan 30, 2024

is it Ok if I update spinedb_api's requirements.txt to install oracledb instead of cx_oracle?

I think we can drop cx_oracle. If we do, "oracle" should also be dropped from spinedb_api.helpers.UNSUPPORTED_DIALECTS. The requirements was added to spinedb_api ~3 months ago by me. It was not needed before and I do not think it will be needed in the future either. I just added it for completeness sake.

The cx_oracle requirement raises from SQLAlchemy which needs it to access Oracle databases.

We do not (yet) support Oracle databases for Spine data (only SQLite and MySQL are supported). The only use for cx_oracle is if somebody wants to import/export data or create an URL to such DB in Data Connection.

ptsavol added a commit that referenced this issue Jan 30, 2024
…ws (#2534)

- Don't limit psutil version because newer ones have wheels on PyPi for Python 3.10+
- Update Readme.md
  - Remove mentions about requiring Microsoft Visual Build Tools
  - Recommend Python 3.11 instead 3.9

Re #2524
ptsavol added a commit to spine-tools/spine-items that referenced this issue Jan 30, 2024
@ptsavol
Copy link
Member Author

ptsavol commented Jan 30, 2024

This should be fixed now in 0.8-dev branches. Anybody want to try this out before I merge this to master as well?

I also updated readme.md so that visual studio build tools are not mentioned there anymore and we now suggest using Python 3.11 instead of Python 3.9.

@soininen
Copy link
Contributor

Nice work! Hopefully the performance improvements of Python 3.11 will show up in Toolbox as well.

@soininen
Copy link
Contributor

soininen commented Apr 3, 2024

@PekkaSavolainen Can this issue be closed now?

@ptsavol
Copy link
Member Author

ptsavol commented Apr 3, 2024

I'm 95% sure this is fixed but I was waiting on somebody to confirm. I guess I should merge the fix to master as well and then close it.

@ptsavol
Copy link
Member Author

ptsavol commented Jun 6, 2024

This is still a problem on Python 3.12. Tried pipx install on Win11 with Python 3.12.3 installed from the Microsoft Store and this happened.

C:\Users\ttepsa>python -m pipx install spinetoolbox
Fatal error from pip prevented installation. Full pip output in file:
    C:\Users\ttepsa\pipx\logs\cmd_2024-06-06_11.43.29_pip_errors.log

pip failed to build package:
    gdxcc

Some possibly relevant errors from pip install:
    error: subprocess-exited-with-error
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

Error installing spinetoolbox.

The same thing happens with a regular Python 3.12 downloaded from python.org. The problem is probably that there are no gdxcc wheels on PyPI for Python 3.12.

@ptsavol
Copy link
Member Author

ptsavol commented Sep 13, 2024

This should now be fixed for Python 3.12!

I'll expect this same thing to happen when Python 3.13 is released (at least in the beginning of it's life cycle).

@ptsavol ptsavol closed this as completed Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants