S-C-O-U-T / Pyadomd

A pythonic approach to query SSAS data models.
https://pyadomd.readthedocs.io/en/latest/index.html
Apache License 2.0
25 stars 6 forks source link

Python 3.9 and 3.10 support #12

Open matthew1davis opened 2 years ago

matthew1davis commented 2 years ago

As mentioned in this Stackoverflow post it seems that this library currently does not support Python 3.9 (originally released October 2020) or Python 3.10 (original released last month October 2021). When trying to install this library in with a Python 3.9 version using pip, I face the following error:

C:\Python39\libs> pip install pyadomd
Collecting pyadomd
  Using cached pyadomd-0.1.0.tar.gz (5.2 kB)
  Preparing metadata (setup.py) ... done
Collecting pythonnet
  Using cached pythonnet-2.5.2.tar.gz (1.9 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pycparser in c:\python39\lib\site-packages (from pythonnet->pyadomd) (2.20)
Using legacy 'setup.py install' for pyadomd, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pythonnet, since package 'wheel' is not installed.
Installing collected packages: pythonnet, pyadomd
    Running setup.py install for pythonnet ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\some_username\\AppData\\Local\\Temp\\2\\pip-install-xseq24q1\\pythonnet_bf3f0e493d964733872d8df8031a0b0a\\setup.py'"'"'; __file__='"'"'C:\\Users\\some_username\\AppData\\Local\\Temp\\2\\pip-install-xseq24q1\\pythonnet_bf3f0e493d964733872d8df8031a0b0a\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\some_username\AppData\Local\Temp\2\pip-record-msa6cxi6\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Python39\Include\pythonnet'
         cwd: C:\Users\some_username\AppData\Local\Temp\2\pip-install-xseq24q1\pythonnet_bf3f0e493d964733872d8df8031a0b0a\
    Complete output (6 lines):
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help

    error: option --single-version-externally-managed not recognized
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\some_username\\AppData\\Local\\Temp\\2\\pip-install-xseq24q1\\pythonnet_bf3f0e493d964733872d8df8031a0b0a\\setup.py'"'"'; __file__='"'"'C:\\Users\\some_username\\AppData\\Local\\Temp\\2\\pip-install-xseq24q1\\pythonnet_bf3f0e493d964733872d8df8031a0b0a\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\some_username\AppData\Local\Temp\2\pip-record-msa6cxi6\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Python39\Include\pythonnet' Check the logs for full command output.

To resolve... I believe the setup.py file needs to be updated to include an explicit callout for Python 3.9?

matthew1davis commented 2 years ago

On the pythonnet Github there is a open issue related to this official Python 3.9 support: #1389

S-C-O-U-T commented 2 years ago

Unfortunately, we are dependent on the pythonnet projects releasing a version where both Python 3.9 and 3.10 are supported.

Paulien23 commented 2 years ago

I was wondering if there is a timeline for when 3.9 will be supported?

S-C-O-U-T commented 2 years ago

The package are dependent on Pythonnet. Pythonnet does not official support python 3.9 and 3.10. When it does, Pyadomd will also support 3.9 and 3.10. Please see #1389

I'll leave the incident open, until the package support newer versions of python.

Coegmen commented 2 years ago

Has there been any new news on pythonnet support for at least 3.9? Asking for a friend...

ghost commented 2 years ago

Has there been any new news on pythonnet support for at least 3.9? Asking for a friend...

According to PythonNet they already merged .Net Core support to master and currently PythonNet 3.0 is in preview stage.

S-C-O-U-T commented 2 years ago

Thx for writing!

Pythonnet have an alpha release on PyP, but I rather wait for an “official” 3.0 release. If you like to help, you could try to install the pythonnet 3.0.0a2 from PyPi:

pip install pythonnet==3.0.0a2

and test whether it will work together with Pyadomd, or not.

When I got the time, I’ll do that myself 😊

matthew1davis commented 2 years ago

I have installed the Pythonnet alpha package with my Python 3.9.7 environment and it works with Pyadomd, no changes required!

matthew1davis commented 1 year ago

Just wanting to revive an old thread, it seems pythonnet has released an official version and is now on pythonnet==3.0.1 as of November 2, 2022 (Reference Pythonnet Github Repository Releases Page). Any chance we can get the testing for Pyadomd done with that dependency now?