wemake-services / wemake-django-template

Bleeding edge django template focused on code quality and security.
https://wemake-django-template.rtfd.io
MIT License
1.99k stars 214 forks source link

[EnvCommandError]: package directory '<project_name>/lib/python3/7/site-packages/ pip' does not exist #831

Closed ProbonoBonobo closed 5 years ago

ProbonoBonobo commented 5 years ago

Installation on a fresh python3.7.3 venv fails with an environment error:

➜  hamfacts poetry install
Creating virtualenv hamfacts-py3.7 in /home/kzeidler/.cache/pypoetry/virtualenvs
Installing dependencies from lock file

Package operations: 141 installs, 0 updates, 0 removals

  - Installing smmap2 (2.0.5)
  - Installing entrypoints (0.3)
  - Installing gitdb2 (2.0.5)
  - Installing mccabe (0.6.1)
  - Installing pbr (5.2.1)
  - Installing pycodestyle (2.5.0)
  - Installing pyflakes (2.1.1)
  - Installing six (1.12.0)
  - Installing zipp (0.5.1)
  - Installing certifi (2019.3.9)
  - Installing chardet (3.0.4)
  - Installing colorama (0.3.9)
  - Installing flake8 (3.7.7)
  - Installing gitpython (2.1.11)
  - Installing idna (2.8)
  - Installing importlib-metadata (0.17)
  - Installing markupsafe (1.1.1)
  - Installing pyparsing (2.4.0)
  - Installing pytz (2019.1)
  - Installing pyyaml (4.2b4)
  - Installing snowballstemmer (1.2.1)
  - Installing sqlparse (0.3.0)
  - Installing stevedore (1.30.1)
  - Installing urllib3 (1.25.3)
  - Installing alabaster (0.7.12)
  - Installing atomicwrites (1.3.0)
  - Installing attrs (18.2.0)
  - Installing babel (2.7.0)
  - Installing bandit (1.6.0)
  - Installing click (6.7)
  - Installing decorator (4.4.0)
  - Installing django (2.2.3)
  - Installing docutils (0.14)
  - Installing eradicate (1.0)
  - Installing flake8-polyfill (1.0.2)
  - Installing imagesize (1.1.0)
  - Installing ipython-genutils (0.2.0)
  - Installing isort (4.3.20)
  - Installing jinja2 (2.10.1)
  - Installing mando (0.6.4)
  - Installing more-itertools (7.0.0)
  - Installing packaging (19.0)
  - Installing parso (0.5.0)
  - Installing pluggy (0.12.0)
  - Installing ptyprocess (0.6.0)
  - Installing py (1.8.0)
  - Installing pycparser (2.19)
  - Installing pydocstyle (3.0.0)
  - Installing pygments (2.4.2)
  - Installing requests (2.22.0)
  - Installing sphinxcontrib-applehelp (1.0.1)
  - Installing sphinxcontrib-devhelp (1.0.1)
  - Installing sphinxcontrib-htmlhelp (1.0.2)
  - Installing sphinxcontrib-jsmath (1.0.1)
  - Installing sphinxcontrib-qthelp (1.0.2)
  - Installing sphinxcontrib-serializinghtml (1.1.3)
  - Installing testfixtures (6.8.2)
  - Installing typing (3.6.6)
  - Installing wcwidth (0.1.7)
  - Installing aspy.yaml (1.3.0)
  - Installing astor (0.7.1)
  - Installing backcall (0.1.0)
  - Installing blinker (1.4)
  - Installing cffi (1.12.3)
  - Installing cfgv (2.0.0)
  - Installing click-default-group (1.2)
  - Installing coverage (4.5.3)
  - Installing django-appconf (1.0.3)
  - Installing django-ipware (2.1.0)
  - Installing docopt (0.6.2)
  - Installing dparse (0.4.1)
  - Installing flake8-annotations-complexity (0.0.2)
  - Installing flake8-bandit (2.1.1)
  - Installing flake8-broken-line (0.1.0)
  - Installing flake8-bugbear (19.3.0)
  - Installing flake8-builtins (1.4.1)
  - Installing flake8-coding (1.3.1)
  - Installing flake8-commas (2.0.0)
  - Installing flake8-comprehensions (2.1.0)
  - Installing flake8-debugger (3.1.0)
  - Installing flake8-docstrings (1.3.0)
  - Installing flake8-eradicate (0.2.0)
  - Installing flake8-isort (2.7.0)
  - Installing flake8-logging-format (0.6.0)
  - Installing flake8-pep3101 (1.2.1)
  - Installing flake8-print (3.1.0)
  - Installing flake8-quotes (1.0.0)
  - Installing flake8-string-format (0.2.3)
  - Installing identify (1.4.3)
  - Installing jedi (0.13.3)
  - Installing mypy-extensions (0.4.1)
  - Installing nodeenv (1.3.3)
  - Installing pathspec (0.5.9)
  - Installing pep8-naming (0.8.2)
  - Installing pexpect (4.7.0)
  - Installing pickleshare (0.7.5)
  - Installing ply (3.11)
  - Installing polib (1.1.0)
  - Installing prompt-toolkit (2.0.9)
  - Installing pytest (4.6.4)
  - Installing radon (2.4.0)
  - Installing restructuredtext-lint (1.3.0)
  - Installing sphinx (2.1.2)
  - Installing toml (0.10.0)
  - Installing traitlets (4.3.2)
  - Installing typed-ast (1.4.0)
  - Installing typing-extensions (3.7.2)
  - Installing virtualenv (16.6.0)
  - Installing bcrypt (3.1.7)
  - Installing dennis (0.9)
  - Installing django-axes (5.0.7)
  - Installing django-csp (3.5)
  - Installing django-debug-toolbar (2.0)
  - Installing django-feature-policy (2.3.0)
  - Installing django-health-check (3.10.2)
  - Installing django-querycount (0.7.0)
  - Installing django-split-settings (0.3.0)
  - Installing doc8 (0.8.0)
  - Installing dotenv-linter (0.1.4)
  - Installing dump-env (1.0.0)
  - Installing flake8-django (0.0.4)
  - Installing flake8-pytest (1.3)
  - Installing gunicorn (19.9.0)
  - Installing ipython (7.6.0)
  - Installing mypy (0.711)
  - Installing nplusone (1.0.0)
  - Installing polint (0.4)
  - Installing pre-commit (1.17.0)
  - Installing psycopg2 (2.8.3)
  - Installing pytest-cov (2.7.1)
  - Installing pytest-deadfixtures (2.1.0)
  - Installing pytest-django (3.5.1)
  - Installing pytest-randomly (3.0.0)
  - Installing pytest-testmon (0.9.16)
  - Installing pytest-timeout (1.3.3)
  - Installing python-decouple (3.1)
  - Installing safety (1.8.5)
  - Installing sphinx-autodoc-typehints (1.6.0)
  - Installing wemake-python-styleguide (0.9.0)
  - Installing xenon (0.5.5)
  - Installing yamllint (1.16.0)
  - Installing hamfacts (0.1.0)                          
[EnvCommandError]                                       
Command ['/home/kzeidler/.cache/pypoetry/virtualenvs/hamfacts-py3.7        
/bin/python', '-m', 'pip', 'install', '-e', '/home/kzeidler/dev/ham  
facts'] errored with the following output:                           
Obtaining file:///home/kzeidler/dev/hamfacts                         
    Complete output from command python setup.py egg_info:           
    running egg_info                                                 
    creating hamfacts.egg-info                                       
    writing hamfacts.egg-info/PKG-INFO                               
    writing dependency_links to hamfacts.egg-info/dependency_links.  
txt                                                                  
    writing requirements to hamfacts.egg-info/requires.txt           
    writing top-level names to hamfacts.egg-info/top_level.txt       
    writing manifest file 'hamfacts.egg-info/SOURCES.txt'            
    package init file 'hamfacts/__init__.py' not found (or not a re  
gular file)                                                          
    error: package directory 'hamfacts/lib/python3/7/site-packages/  
pip' does not exist                                                                                           
    ----------------------------------                         
Command "python setup.py egg_info" failed with error code 1 in /hom  
e/kzeidler/dev/hamfacts/                                             
You are using pip version 19.0.3, however version 19.1.1 is availab  
le.                                                                  
You should consider upgrading via the 'pip install --upgrade pip' c  
ommand.                                                                                                                
install [--no-dev] [--dry-run] [-E|--extras EXTRAS] [--develop DEVELOP]

It looks like the virtual environment's PYTHONPATH is getting incorrectly resolved to a non-existent directory ('*python3/7/site-packages') at some point in the build. Unclear where this is getting set, but grep lights up when searching easy_install.py for pathy strings:

(testenv) kzeidler@fermium:~/dev/hamfacts$ egrep --color=always -R "py_version_short" *
testenv/lib/python3.7/site-packages/setuptools/command/easy_install.py:            'py_version_short': py_version[0:3],
testenv/lib/python3.7/site-packages/setuptools/command/easy_install.py:            install_dir='$base/lib/python$py_version_short/site-packages',
Binary file testenv/lib/python3.7/site-packages/setuptools/command/__pycache__/easy_install.cpython-37.pyc matches
testenv/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.cfg:stdlib = {base}/lib/python{py_version_short}
testenv/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.cfg:platstdlib = {platbase}/lib/python{py_version_short}
testenv/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.cfg:purelib = {base}/lib/python{py_version_short}/site-packages
testenv/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.cfg:platlib = {platbase}/lib/python{py_version_short}/site-packages
testenv/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.cfg:include = {base}/include/python{py_version_short}{abiflags}

Output of poetry debug:info:

Poetry
======

 * Version: 0.12.16
 * Python:  3.7.3

Virtualenv
==========

 * Python:         3.7.3
 * Implementation: CPython
 * Path:           /home/kzeidler/.cache/pypoetry/virtualenvs/hamfacts-py3.7
 * Valid:          True

System
======

 * Platform: linux
 * OS:       posix
 * Python:   /home/kzeidler/.pyenv/versions/3.7.3
sobolevn commented 5 years ago

Are you sure that you haven't changed this folder name?

Because hamfacts (cool name!) should not be installed. And it clearly is not in our setup: https://travis-ci.org/wemake-services/wemake-django-template/builds/553152947#L728

If you haven't changed anything, can you please provide a reproduction details / steps?

sobolevn commented 5 years ago

Considering this as solved. Feel free to ask new questions.