-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Pipenv install relative paths fails when the Pipfile is not in current directory. #3776
Comments
What's more. I find another two problems. (1.) (3.) With the same virtual environment as above, The Pipfile is placed different from where my local development project is. For exmaple
And the error message for (3.) . Installing -e .…
Traceback (most recent call last):
File "/home/jimmy/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 90, in __init__
req = REQUIREMENT.parseString(requirement_string)
File "/home/jimmy/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1654, in parseString
raise exc
File "/home/jimmy/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1644, in parseString
loc, tokens = self._parse( instring, 0 )
File "/home/jimmy/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1402, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/home/jimmy/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 3417, in parseImpl
loc, exprtokens = e._parse( instring, loc, doActions )
File "/home/jimmy/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1402, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/home/jimmy/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 3739, in parseImpl
return self.expr._parse( instring, loc, doActions, callPreParse=False )
File "/home/jimmy/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1402, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/home/jimmy/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 3400, in parseImpl
loc, resultlist = self.exprs[0]._parse( instring, loc, doActions, callPreParse=False )
File "/home/jimmy/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1406, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/home/jimmy/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 2711, in parseImpl
raise ParseException(instring, loc, self.errmsg, self)
pkg_resources._vendor.pyparsing.ParseException: Expected W:(abcd...) (at char 0), (line:1, col:1)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/jimmy/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3092, in __init__
super(Requirement, self).__init__(requirement_string)
File "/home/jimmy/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 94, in __init__
requirement_string[e.loc:e.loc + 8]))
pkg_resources.extern.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'.'"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/mnt/fedora-home/jimmy/workspace/devel/github/pypa/pipenv/pipenv/vendor/requirementslib/models/requirements.py", line 912, in _parse_name_from_line
self._requirement = init_requirement(self.line)
File "/mnt/fedora-home/jimmy/workspace/devel/github/pypa/pipenv/pipenv/vendor/requirementslib/models/utils.py", line 196, in init_requirement
req = Requirement.parse(name)
File "/home/jimmy/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3138, in parse
req, = parse_requirements(s)
File "/home/jimmy/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3085, in parse_requirements
yield Requirement(line)
File "/home/jimmy/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3094, in __init__
raise RequirementParseError(str(e))
pkg_resources.RequirementParseError: Invalid requirement, parse error at "'.'"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/jimmy/.pyenv/versions/3.7-dev/bin/pipenv", line 11, in <module>
load_entry_point('pipenv', 'console_scripts', 'pipenv')()
File "/mnt/fedora-home/jimmy/workspace/devel/github/pypa/pipenv/pipenv/vendor/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/mnt/fedora-home/jimmy/workspace/devel/github/pypa/pipenv/pipenv/vendor/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/mnt/fedora-home/jimmy/workspace/devel/github/pypa/pipenv/pipenv/vendor/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/mnt/fedora-home/jimmy/workspace/devel/github/pypa/pipenv/pipenv/vendor/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/mnt/fedora-home/jimmy/workspace/devel/github/pypa/pipenv/pipenv/vendor/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/mnt/fedora-home/jimmy/workspace/devel/github/pypa/pipenv/pipenv/vendor/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/mnt/fedora-home/jimmy/workspace/devel/github/pypa/pipenv/pipenv/vendor/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/mnt/fedora-home/jimmy/workspace/devel/github/pypa/pipenv/pipenv/vendor/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/mnt/fedora-home/jimmy/workspace/devel/github/pypa/pipenv/pipenv/cli/command.py", line 255, in install
editable_packages=state.installstate.editables,
File "/mnt/fedora-home/jimmy/workspace/devel/github/pypa/pipenv/pipenv/core.py", line 2066, in do_install
pkg_requirement = Requirement.from_line(pkg_line)
File "/mnt/fedora-home/jimmy/workspace/devel/github/pypa/pipenv/pipenv/vendor/requirementslib/models/requirements.py", line 2732, in from_line
r = named_req_from_parsed_line(parsed_line)
File "/mnt/fedora-home/jimmy/workspace/devel/github/pypa/pipenv/pipenv/vendor/requirementslib/models/requirements.py", line 3201, in named_req_from_parsed_line
if parsed_line.name is not None:
File "/mnt/fedora-home/jimmy/workspace/devel/github/pypa/pipenv/pipenv/vendor/requirementslib/models/requirements.py", line 594, in name
self.parse_name()
File "/mnt/fedora-home/jimmy/workspace/devel/github/pypa/pipenv/pipenv/vendor/requirementslib/models/requirements.py", line 972, in parse_name
name = self._parse_name_from_line()
File "/mnt/fedora-home/jimmy/workspace/devel/github/pypa/pipenv/pipenv/vendor/requirementslib/models/requirements.py", line 915, in _parse_name_from_line
"Failed parsing requirement from {0!r}".format(self.line)
pipenv.vendor.requirementslib.exceptions.RequirementError: Failed parsing requirement from '. |
pipenv install -e git+git@
, 2. Fail to pipenv install -e .
, if Pipfile is put in a different place。
Looks like #3647. |
|
pipenv install -e git+git@
, 2. Fail to pipenv install -e .
, if Pipfile is put in a different place。
I'm having a similar issue, except no change of current directory and setting One workaround I've tried is using variable expansion, i.e. I can try making a small example package that reproduces this if that helps. |
Nevermind, looking closer at the traceback it seems that the issue stems from the parser of requirementslib for some reason - that's what I get for responding to issues at 2 AM. 🙃 |
Anyone care to recheck this on latest pipenv? |
I believe this is fixed on overhaul branch that is out for review: #5793 |
I believe this is resolved now. |
#2896
#2896 (comment)
@techalchemy
This happens to me also.
Yes, I am using
pyenv-virtualenv
pyenv
pipenv
Reproduce
mkdir -v /tmp/hello && cd /tmp/hello
pipenv --python=/home/jimmy/.pyenv/versions/3.7-dev/envs/quant/bin/python --site-packages
pipenv --venv
/home/jimmy/.venvs/quant-6R1YVBAt-/home/jimmy/.pyenv/shims/python
Actual Result
pipenv --venv
/home/jimmy/.venvs/quant-6R1YVBAt-/home/jimmy/.pyenv/shims/python
Expected Result
pipenv --venv
/home/jimmy/.venvs/quant-6R1YVBAt-${python_version}
Or
/home/jimmy/.venvs/quant-6R1YVBAt
pipenv --suport
{'implementation_name': 'cpython',
'implementation_version': '3.7.3',
'os_name': 'posix',
'platform_machine': 'x86_64',
'platform_python_implementation': 'CPython',
'platform_release': '4.19.47-1-MANJARO',
'platform_system': 'Linux',
'platform_version': '#1 SMP PREEMPT Fri May 31 16:47:49 UTC 2019',
'python_full_version': '3.7.3+',
'python_version': '3.7',
'sys_platform': 'linux'}
Contents of
Pipfile.lock
('/home/jimmy/.venvs/quant/Pipfile.lock'):The text was updated successfully, but these errors were encountered: