Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

66%
+2 −0
Q&A Reinstall old Python libraries after update

The pip freeze command may output individual dependencies with format zipp @ file:///Users/abcxyz/work/recipes/ci_py311/zipp_1677907997878/work Using this output will not work (unless you happen ...

posted 5mo ago by mudskipper‭

Answer
#1: Initial revision by user avatar mudskipper‭ · 2024-06-03T15:23:00Z (5 months ago)
The `pip freeze` command may output individual dependencies with format 

`zipp @ file:///Users/abcxyz/work/recipes/ci_py311/zipp_1677907997878/work`

Using this output will not work (unless you happen to be that user `abcxyz`). To generate a requirements file that does not refer to local, non-existing or no-longer existing cache directories, you can instead use 

`pip list --format=freeze > requirements.txt`

which will generate a requirements.txt file that only lists the specific versions, in the format `zipp==3.11.0`.

If you then run `pip install -r requirements.txt` for a newer version of Python, you may sometimes run into version conflicts. You can try to fix those by not pinning the dependency to a specific version (so simply by removing the `==3.11.0` in the example of `zipp==3.11.0`), but in some cases there may be no fix (if a dependency has no release yet for the newer Python and the older version somehow cannot be installed); in the worst case you'll have to temporarily remove the 3d party library.