0

I want to setup a python3 virtual environment with existing installed packages.

I am currently on a cluster environment and there are many python modules installed. i.e python/3.7.4 python/3.8.4 and so on.

I can not install any packages to this shared/public modules. But I can set up my own virtual environment using these modules.

Lets say, python/3.8.4 module has a package installed named "my_package", and this package depends on system environment (i.e GNU libc 2.17). I can not install "my_package" in my virtual environment since I can not install anything that directly depends on system environment.

So if it may possible, I create virtual environment from python/3.8.4 named "python_284_venv" which will copy existing site packages (i.e. "my_package") installed in my virtual environment.

Thanks in advance.

Anowarul Kabir
  • 47
  • 1
  • 1
  • 6
  • 1
    Does this answer your question? [Make virtualenv inherit specific packages from your global site-packages](https://stackoverflow.com/questions/12079607/make-virtualenv-inherit-specific-packages-from-your-global-site-packages) – ChrisGPT was on strike Jul 30 '20 at 01:54
  • You can install any packages into the new virtual environment you have just created since you would have all the required permission to the environment you have just created. This keeps environments isolated from each other. The whole point of virtual environment is that there is always a "blank slate" to work from such that specific sets of packages required be installed before the target application is installed (thus satisfy the goal of "existing installed packages" - just that it has to be done immediately after creation of the environment). – metatoaster Jul 30 '20 at 01:58
  • @Chris it was exactly what I was looking for. Thanks a lot. The exactly command I uses ```python -m venv python_384_venv --system-site-packages``` – Anowarul Kabir Jul 30 '20 at 05:47

0 Answers0