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

Invalid marker error running 'pipenv install' on Windows #1622

Closed
veaviticus opened this issue Mar 8, 2018 · 2 comments
Closed

Invalid marker error running 'pipenv install' on Windows #1622

veaviticus opened this issue Mar 8, 2018 · 2 comments

Comments

@veaviticus
Copy link

Be sure to check the existing issues, both open and closed.

Installing dependencies via pipenv install fails with an Invalid marker error. See below steps for full output.

Describe your environment
  1. OS Type:
    Windows 7

  2. Python version: $ python -V

3.6.4

  1. Pipenv version: $ pipenv --version
    11.1.5
Expected result

Dependencies are installed

Actual result

Invalid marker error and stacktrace is thrown

Steps to replicate
  1. Create a fresh environment using Miniconda3
C:\test> conda info
Current conda install:

               platform : win-64
          conda version : 4.3.30
       conda is private : False
      conda-env version : 4.3.30
    conda-build version : not installed
         python version : 3.4.5.final.0
       requests version : 2.12.4
       root environment : C:\Miniconda3  (writable)
    default environment : C:\Miniconda3\envs\tmp364
       envs directories : C:\Miniconda3\envs
          package cache : C:\Miniconda3\pkgs
           channel URLs : https://repo.continuum.io/pkgs/main/win-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/win-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/win-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/win-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://repo.continuum.io/pkgs/msys2/win-64
                          https://repo.continuum.io/pkgs/msys2/noarch
            config file : None
             netrc file : None
           offline mode : False
             user-agent : conda/4.3.30 requests/2.12.4 CPython/3.4.5 Windows/7 Windows/6.1.7601
          administrator : True
C:\Test>conda create -n tmp364 python=3.6.4
Fetching package metadata .............
Solving package specifications: .

Package plan for installation in environment C:\Miniconda3\envs\tmp364:

The following NEW packages will be INSTALLED:

    certifi:        2018.1.18-py36_0
    pip:            9.0.1-py36_5
    python:         3.6.4-h6538335_1
    setuptools:     38.5.1-py36_0
    vc:             14-h0510ff6_3
    vs2015_runtime: 14.0.25123-3
    wheel:          0.30.0-py36h6c3ec14_1
    wincertstore:   0.2-py36h7fe50ca_0

Proceed ([y]/n)? y

vs2015_runtime 100% |###############################| Time: 0:00:00   9.00 MB/s
vc-14-h0510ff6 100% |###############################| Time: 0:00:00 657.82 kB/s
python-3.6.4-h 100% |###############################| Time: 0:00:01  22.29 MB/s
certifi-2018.1 100% |###############################| Time: 0:00:00   8.17 MB/s
wincertstore-0 100% |###############################| Time: 0:00:00   1.97 MB/s
setuptools-38. 100% |###############################| Time: 0:00:00  10.51 MB/s
wheel-0.30.0-p 100% |###############################| Time: 0:00:00   8.69 MB/s
pip-9.0.1-py36 100% |###############################| Time: 0:00:00  11.32 MB/s
#
# To activate this environment, use:
# > activate tmp364
#
# To deactivate an active environment, use:
# > deactivate
#
# * for power-users using bash, you must source
#
  1. Activate environment
C:\Test>activate tmp364
  1. Install pipenv
(tmp364) C:\Test>pip install --upgrade pipenv
Collecting pipenv
Collecting virtualenv (from pipenv)
  Using cached virtualenv-15.1.0-py2.py3-none-any.whl
Collecting psutil==5.3.1; sys_platform == "win32" (from pipenv)
  Using cached psutil-5.3.1-cp36-cp36m-win_amd64.whl
Collecting virtualenv-clone>=0.2.5 (from pipenv)
  Using cached virtualenv_clone-0.3.0-py2.py3-none-any.whl
Installing collected packages: virtualenv, psutil, virtualenv-clone, pipenv
Successfully installed pipenv-11.1.5 psutil-5.3.1 virtualenv-15.1.0 virtualenv-clone-0.3.0
  1. Create pipenv environment in project
(tmp364) C:\Test>set PIPENV_VENV_IN_PROJECT=1

(tmp364) C:\Test>python -m pipenv --python=C:\Miniconda3\envs\tmp364\python.exe
Removing existing virtualenv…
Creating a virtualenv for this project…
Using C:\Miniconda3\envs\tmp364\python.exe to create virtualenv…
Running virtualenv with interpreter C:\Miniconda3\envs\tmp364\python.exe
Using base prefix 'C:\\Miniconda3\\envs\\tmp364'
New python executable in C:\Test\.venv\Scripts\python.exe
Installing setuptools, pip, wheel...done.

Virtualenv location: C:\Test\.venv
  1. Install dependencies
(tmp364) C:\Test>pipenv install --verbose
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
  File "C:\\Miniconda3\\envs\\tmp364\\lib\\site-packages\\pipenv\\resolver.py", line 19, in resolve
    return pipenv.utils.resolve_deps(packages, which, project=project, pre=pre, sources=sources, clear=clear, verbose=verbose)
  File "C:\\Miniconda3\\envs\\tmp364\\lib\\site-packages\\pipenv\..\pipenv\utils.py", line 392, in resolve_deps
    resolved_tree, resolver = actually_resolve_reps(deps, index_lookup, markers_lookup, project, sources, verbose, clear, pre)
  File "C:\\Miniconda3\\envs\\tmp364\\lib\\site-packages\\pipenv\..\pipenv\utils.py", line 325, in actually_resolve_reps
    resolved_tree.update(resolver.resolve(max_rounds=PIPENV_MAX_ROUNDS))
  File "C:\Miniconda3\envs\tmp364\lib\site-packages\pipenv\patched\piptools\resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "C:\Miniconda3\envs\tmp364\lib\site-packages\pipenv\patched\piptools\resolver.py", line 200, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "C:\Miniconda3\envs\tmp364\lib\site-packages\pipenv\patched\piptools\resolver.py", line 310, in _iter_dependencies
    yield InstallRequirement.from_line(dependency_string, constraint=ireq.constraint)
  File "C:\Miniconda3\envs\tmp364\lib\site-packages\pipenv\patched\pip\req\req_install.py", line 181, in from_line
    markers = Marker(markers)
  File "C:\Miniconda3\envs\tmp364\lib\site-packages\pipenv\patched\pip\_vendor\packaging\markers.py", line 282, in __init__
    raise InvalidMarker(err_str)
pip._vendor.packaging.markers.InvalidMarker: Invalid marker: 'sys_platform == "win32"; sys_platform == "win32"', parse error at '; sys_pl'

And my pipfile

[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[packages]

pytest = "*"
pytest-ordering = "*"
hypothesis = "*"

[dev-packages]

[requires]

python_version = "3.6"
  • I've tested this on
    • Python 3.6.1, 3.6.2, 3.6.3, and 3.6.4
    • Pipenv 11.0.0 - 11.1.5
@kennethreitz
Copy link
Contributor

thanks for the report.

@kennethreitz
Copy link
Contributor

closing for #1617

techalchemy added a commit that referenced this issue Mar 9, 2018
techalchemy added a commit that referenced this issue Mar 20, 2018
- Fix Overlapping naming checking for inner markers
- Perform a first-pass right-side split of markers and remove other
exact matching markers from the dependency string
- Fixes #1617, #1791, #1805, #1622
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

2 participants