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.

pip clone/ pip copy : install packages in a new environment based on existing envs

See original GitHub issue

What’s the problem this feature will solve?

This will allow to install packages in a new environment based on existing environments

Describe the solution you’d like

Some projects needs to be based on others totally different projects with differents dependencies. This new command will allow to install all dependencies of the new project (by mirroring existing dependencies of another project) without trying to face which dependencies it needs or duplicate version.

It could be with another new pip command called pip clone --source path/to/en1 /path/to/env/2 /path/to/env/3 --target path/to/new_env

Also, if pip clone is executed with only one path (like pip clone --source path/to/en1), this will simply copy the environment to the new path, this will allow to simply create new environments without doing all the pip freeze and pip install flow.

Also if there is conflict between dependecy version, this command will prompt the user which version it should keep. Like version conflict detected between numpy 1.1.0 and numpy 1.1.9 : which one would you keep ?

Alternative Solutions

There is this project https://pypi.org/project/merge-requirements/ But this not a really solution because it still requires to extract requirements.txt files with the pip freeze command. What this feature request suggest is to put all this flow in background with execution of a simple command pip clone

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
pfmoorecommented, Jul 14, 2020

-1. This sounds like a highly specialised need which is currently possible using pip freeze and merging the requirement files, as noted. I don’t think pip should get a whole new subcommand for something this specialised. But I’d be happy to reconsider if more use cases turned up.

0reactions
pradyunsgcommented, Aug 30, 2020

Closing since (it seems to me that) the existing solutions on SO are good-enough for nearly everyone. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing packages using pip and virtual environments
This guide discusses how to install packages using pip and a virtual environment manager: either venv for Python 3 or virtualenv for Python...
Read more >
How to duplicate virtualenv - python - Stack Overflow
The easiest way is to use pip to generate a requirements file. A requirements file is basically a file that contains a list...
Read more >
How to clone Python working environment on another machine?
Then use virtual environment tools to duplicate your environments. In the working virtualenv, create a file with the version of each installed Python...
Read more >
Environments, Conda, Pip, aaaaah! | by Dennis Bakhuis
To install that package, open another shell next to the one you are already using, activate the environment, and use pip to install...
Read more >
Pipenv & Virtual Environments
Using $ pipenv run ensures that your installed packages are available to your script. It's also possible to spawn a new shell that...
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