Closed waitasecant closed 7 months ago
@waitasecant could you reply with the commands you used to create the venv and install. I tried on a fresh venv for both MacOS and Windows and I was unable to replicate.
Could you run these two commands as well so we get a better idea of your environment?
python -c "import sys; print(sys.version.replace('\n', ' '))"
)python -c "import platform; print(platform.platform())"
)Thanks for your timely response. I hope this helps.
Command used to create the venv:
python -m venv venv
Command to activate the venv: (In powershell)
venv\Scripts\Activate.ps1
Results of the two commands:
(venv) PS D:\Saroja\MODIS> python -c "import sys; print(sys.version.replace('\n', ' '))"
3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)]
(venv) PS D:\Saroja\MODIS> python -c "import platform; print(platform.platform())"
Windows-10-10.0.19045-SP0
Ah, I was able to recreate once I bumped my windows python version to 3.12. I'll create a task and have the team investigate. Additionally, if you'd like to, I always invite open source contributions if you're interested in taking a stab at it. I don't have a time estimate for completion, but I appreciate you bringing it to my attention. Here's the full output for my replication:
PS C:\Users\Jamie> cd C:\Users\Jamie\Downloads\test
PS C:\Users\Jamie\Downloads\test> python -m venv venv
PS C:\Users\Jamie\Downloads\test> venv\Scripts\Activate.ps1
(venv) PS C:\Users\Jamie\Downloads\test> pip freeze
(venv) PS C:\Users\Jamie\Downloads\test> pip install modis-tools
Collecting modis-tools
Obtaining dependency information for modis-tools from https://files.pythonhosted.org/packages/4b/b4/6021fab972d5254a117106abb76aeff17bedfb2a23f543bf7474ce0753ba/modis_tools-1.1.3-py3-none-any.whl.metadata
Downloading modis_tools-1.1.3-py3-none-any.whl.metadata (10 kB)
Collecting requests==2.* (from modis-tools)
Obtaining dependency information for requests==2.* from https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl.metadata
Downloading requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
Collecting pydantic==1.* (from modis-tools)
Obtaining dependency information for pydantic==1.* from https://files.pythonhosted.org/packages/27/17/a9872f20809e37ad03c523994ef3e0b7420c6508fe4553b7c0d8476ee03a/pydantic-1.10.15-py3-none-any.whl.metadata
Downloading pydantic-1.10.15-py3-none-any.whl.metadata (150 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 150.6/150.6 kB 1.5 MB/s eta 0:00:00
Collecting python-dateutil==2.* (from modis-tools)
Obtaining dependency information for python-dateutil==2.* from https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata
Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting shapely==1.* (from modis-tools)
Downloading Shapely-1.8.5.post1.tar.gz (200 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 200.9/200.9 kB 6.0 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [33 lines of output]
Traceback (most recent call last):
File "C:\Users\Jamie\Downloads\test\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Users\Jamie\Downloads\test\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jamie\Downloads\test\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 112, in get_requires_for_build_wheel
backend = _build_backend()
^^^^^^^^^^^^^^^^
File "C:\Users\Jamie\Downloads\test\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 77, in _build_backend
obj = import_module(mod_path)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jamie\AppData\Local\Programs\Python\Python312\Lib\importlib\__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
File "<frozen importlib._bootstrap>", line 1304, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
File "<frozen importlib._bootstrap>", line 1325, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 929, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 994, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "C:\Users\Jamie\AppData\Local\Temp\pip-build-env-ih3y7zn9\overlay\Lib\site-packages\setuptools\__init__.py", line 16, in <module>
import setuptools.version
File "C:\Users\Jamie\AppData\Local\Temp\pip-build-env-ih3y7zn9\overlay\Lib\site-packages\setuptools\version.py", line 1, in <module>
import pkg_resources
File "C:\Users\Jamie\AppData\Local\Temp\pip-build-env-ih3y7zn9\overlay\Lib\site-packages\pkg_resources\__init__.py", line 2191, in <module>
register_finder(pkgutil.ImpImporter, find_on_path)
^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
[notice] A new release of pip is available: 23.2.1 -> 24.0
[notice] To update, run: python.exe -m pip install --upgrade pip
(venv) PS C:\Users\Jamie\Downloads\test> python -c "import sys; print(sys.version.replace('\n', ' '))"
3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)]
(venv) PS C:\Users\Jamie\Downloads\test> python -c "import platform; print(platform.platform())"
Windows-11-10.0.22621-SP0
(venv) PS C:\Users\Jamie\Downloads\test>
Hi @jamie-sgro
Thank you for being FOR the open source contributions. I've made the necessary changes to address the problem. Additionally, I've submitted a pull request #49 with the fix.
To resolve the issue,
setuptools
as a dependency in the requirements.txt
file conditioning the python version >= 3.12. setuptools
is no longer installed by default on virtual environment creation. (See https://docs.python.org/3/whatsnew/3.12.html and https://github.com/python/cpython/issues/95299)From my end, now the package is getting installed without any error without breaking any change. Your feedback and contributions are greatly appreciated. If you have any further questions or concerns, please don't hesitate to let me know. I'm here to help!
Best regards, Himanshu
@jamie-sgro Reminder: I've made the required changes, please review the PR #49 Hope this helps :)
Thanks for the reminder @waitasecant I was OOO till today, but can take a look at it now that I'm back
@waitasecant I've just redeployed PyPi and confirmed the same code that previously failed now succeeds on modis-tools version 1.1.4
@jamie-sgro happy to help : )
The package gives error in installation.
pip install modis-tools
Any Additional context I first tried installing the package, which errored while installing. Then, I made a virtual environment and then tried installation, which again errored.