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

ValueError on Conda in windows environment #2

Open
Jokipii opened this issue Jan 4, 2020 · 2 comments
Open

ValueError on Conda in windows environment #2

Jokipii opened this issue Jan 4, 2020 · 2 comments

Comments

@Jokipii
Copy link

Jokipii commented Jan 4, 2020

I got ValueError, when I tried to import typed_astunpare in Conda environment:

Python 3.7.3 | packaged by conda-forge | (default, Jul  1 2019, 22:01:29) [MSC v.1900 64 bit (AMD64)] :: Anaconda, Inc. on win64
Type "help", "copyright", "credits" or "license" for more information.
>>> from typed_astunparse import unparse
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramData\Anaconda3\envs\greencarbon\lib\site-packages\typed_astunparse-2.1.4-py3.7.egg\typed_astunparse\__init__.py", line 14, in <module>
    from ._version import VERSION
  File "C:\ProgramData\Anaconda3\envs\greencarbon\lib\site-packages\typed_astunparse-2.1.4-py3.7.egg\typed_astunparse\_version.py", line 5, in <module>
    VERSION = predict_version_str()
  File "C:\ProgramData\Anaconda3\envs\greencarbon\lib\site-packages\version_query-1.0.5-py3.7.egg\version_query\query.py", line 75, in predict_version_str
    return predict_caller(2).to_str()
  File "C:\ProgramData\Anaconda3\envs\greencarbon\lib\site-packages\version_query-1.0.5-py3.7.egg\version_query\query.py", line 71, in predict_caller
    return predict_folder(here, True)
  File "C:\ProgramData\Anaconda3\envs\greencarbon\lib\site-packages\version_query-1.0.5-py3.7.egg\version_query\query.py", line 65, in predict_folder
    return query_folder(path, search_parent_directories=search_parent_directories)
  File "C:\ProgramData\Anaconda3\envs\greencarbon\lib\site-packages\version_query-1.0.5-py3.7.egg\version_query\query.py", line 37, in query_folder
    return query_package_folder(path, search_parent_directories=search_parent_directories)
  File "C:\ProgramData\Anaconda3\envs\greencarbon\lib\site-packages\version_query-1.0.5-py3.7.egg\version_query\py_query.py", line 42, in query_package_folder
    raise ValueError(paths, metadata_json_paths, pkg_info_paths)
ValueError: ([WindowsPath('C:/ProgramData/Anaconda3/envs/greencarbon/lib/site-packages/typed_astunparse-2.1.4-py3.7.egg/typed_astunparse'), WindowsPath('C:/ProgramData/Anaconda3/envs/greencarbon/lib/site-packages/typed_astunparse-2.1.4-py3.7.egg'), WindowsPath('C:/ProgramData/Anaconda3/envs/greencarbon/lib/site-packages'), WindowsPath('C:/ProgramData/Anaconda3/envs/greencarbon/lib'), WindowsPath('C:/ProgramData/Anaconda3/envs/greencarbon'), WindowsPath('C:/ProgramData/Anaconda3/envs'), WindowsPath('C:/ProgramData/Anaconda3'), WindowsPath('C:/ProgramData'), WindowsPath('C:/')], [], [])

In my case 'PNG-INFO' is located on 'C:\ProgramData\Anaconda3\envs\greencarbon\lib\site-packages\typed_astunparse-2.1.4-py3.7.egg\EGG-INFO' directory.
Method 'query_package_folder' in 'py_query.py' tries to find it in 'EGG-INFO' directory, but only if directory name is in lowercase 'egg-info'.

@mbdevpl
Copy link
Owner

mbdevpl commented Jan 29, 2020

@Jokipii Sorry, could you try the fix I just implemented and tell me if it fixes the problem? I don't have any Anaconda on Windows install so I can't test it myself...

Please install this:

pip3 install git+https://github.com/mbdevpl/version-query.git@feature/anaconda-windows

... and then re-run whatever you were trying to do in typed-astunparse#6 to check if it breaks again.

The installation method above means installing directly from my repo, from a specific git branch feature/anaconda-windows on which I added the fix. Other uses are described here: https://stackoverflow.com/questions/20101834/pip-install-from-git-repo-branch

@jhgoebbert
Copy link

This issue in ebrains-drive is related to this:
HumanBrainProject/ebrains-storage#33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants