question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

packaging.requirements.InvalidRequirement: Parse error at "':///home'": Expected stringEnd

See original GitHub issue
  • I have searched the issue tracker and believe that this is not a duplicate.

Make sure you run commands with -v flag before pasting the output.

Steps to reproduce

pip install pdm pdm init pdm add flask

Actual behavior

step1 and step2 has not any error, then i use pdm to add a packages, that has this errors

Expected behavior

parse error at “‘😕//home’”

Environment Information

os: arch
python system version: 3.8.6 use version: 3.7.8 from pyenv pdm install method: pip install pdm

# Paste the output of `pdm info && pdm info --env` below:
pdm info        
PDM version:        0.11.0                                              
Python Interpreter: /home/ajin/.pyenv/versions/3.7.8/bin/python3 (3.7.8)
Project Root:       /home/ajin/code/fastapi_test

pdm info --env
{
  "implementation_name": "cpython",
  "implementation_version": "3.7.8",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "5.9.8-arch1-1",
  "platform_system": "Linux",
  "platform_version": "#1 SMP PREEMPT Tue, 10 Nov 2020 22:44:11 +0000",
  "python_full_version": "3.7.8",
  "platform_python_implementaiton": "CPython",
  "python_version": "3.7",
  "sys_platform": "linux"
}


Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
frostmingcommented, Apr 17, 2021

Just avoid installing PDM into global Python. I don’t know what tooling you are using though, This should solve the problem

3reactions
rmsccommented, Apr 16, 2021

I’m experiencing this exact problem, but weirdly enough it only happens when version is set to something in pyproject.toml:

# works fine:
version = ""
# produces parse error:
version = "0.0.1"

The actual parse error I suspect comes from this:

$ pip freeze | grep home
pdm @ file:///home/<username>/.cache/yay/python-pdm/src/pdm-1.4.5/dist/pdm-1.4.5-py3-none-any.whl
pdm-pep517 @ file:///home/<username>/.cache/yay/python-pdm-pep517/src/pdm-pep517-0.6.1/dist/pdm_pep517-0.6.1-py3-none-any.whl
python-cfonts @ file:///home/<username>/.cache/yay/python-cfonts/src/python-cfonts-1.4.0/dist/python_cfonts-1.4.0-py2.py3-none-any.whl

These strings are put in direct_url.json files installed by pip install, according to PEP610. I’m not sure if system-wide packages are supposed to have these, though.

As a final note, this is a system-wide install in Archlinux, and I happen to be the AUR package maintainer for these three packages.

Read more comments on GitHub >

github_iconTop Results From Across the Web

packaging.requirements.InvalidRequirement: Parse error at ...
I have searched the issue tracker and believe that this is not a duplicate. Make sure you run commands with -v flag before...
Read more >
Trying to Package a Python package up for PYPI getting an ...
raise InvalidRequirement( pkg_resources.extern.packaging.requirements.InvalidRequirement: Parse error at ""['tracew"": Expected W:(abcd...).
Read more >
Requirements for custom_component not installing anymore
InvalidRequirement : Parse error at "'=filterp'": Expected stringEnd. when I add numpy and scipy to my requirements I get the error
Read more >
PEP 621: how to specify dependencies? - Packaging
from packaging.requirements import Requirement requirements ... InvalidRequirement: Parse error at "'python_v'": Expected stringEnd.
Read more >
RequirementParseError: Invalid requirement, parse error at ...
Ilya Chernyakov The problem could be in the RequestsThrottler package itself. Anyway we should be able to handle this error in a better...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found