eia92
eia92

Reputation: 95

'install_requires' must be a string or list of strings containing valid project/version requirement specifiers

Getting error 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers when installing a package with pip. The package is an internal package but seems to error when installing one of the dependencies. Any idea how to solve this error?

My python version is 3.8.2, pip version 23.1.2, mac OS Ventura 13.1

Here is a little more info on the error

Running command Preparing metadata (pyproject.toml)
  error in lasso setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected end or semicolon (after version specifier)
      PyJWT>=1<2 

Upvotes: 2

Views: 12493

Answers (2)

mbenhalima
mbenhalima

Reputation: 752

From: pip install -e . fails with "Expected end or semicolon" for git+https in requirements, but pip install -r succeeds

It looks like setuptools requires the package name to be supplied as a prefix, then the fetch URL after an @, e.g.

# requirements.txt
mypackage @ git+https://github.com/myorg/[email protected]#egg=mypackage

Upvotes: 1

Irish Dev
Irish Dev

Reputation: 134

The syntax of PyJWT>=1<2 is not correct versioning in pyproject.toml

You can write it as follows:

PyJWT >= 1, < 2

or

PyJWT = "^1.0.0"

Upvotes: 1

Related Questions