DiffSK / configobj

Python 3+ compatible port of the configobj library

Home Page:https://configobj.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't install configobj 5.0.6 with pip on embedded python installation

alfeilex opened this issue · comments

It is not possible to install configobj 5.0.6 with pip package manager in an embedded python installation. Installing configobj 5.0.6 with pip via exe installation works without errors. Here is the output of the error:

Collecting configobj>=5.0.5
Using cached configobj-5.0.6.tar.gz (33 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "C:\Users\alfeil\AppData\Local\Temp\pip-install-g4gjt2rb\configobj_1edeed4e30c44f45bbb715635d30e829\setup.py", line 17, in <module>
        from _version import __version__
    ModuleNotFoundError: No module named '_version'
    [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

I was able to figure out that the reason for the error is that the version module is not found in the package directory. I was able to fix this by adding this code snippet to setup.py.

file_dir = os.path.dirname(__file__)
sys.path.append(file_dir)

This suggestion comes from this pypa/pip#11526 (comment)

Could you modify your code to allow current python users who installed python via embeddable zip files to install your package?