-1

I'm trying to clone all the packages of a venv from one PC to another(both having Windows OS). When I'm installing all the wheel packages on the second PC with this command

pip install *.whl

as suggested by AKX in his answer to my question, it's giving me the error as.

*.whl looks like a file but not found in the current directory.

When I installed a package that have no dependencies, it's installed successfully. There is a long list of packages, so I can't install each package by typing the name of whole .whl file.

DevLoverUmar
  • 11,809
  • 11
  • 68
  • 98

1 Answers1

2

If you have access to a bash shell (Git Bash, Cygwin, WSL, or whatever), the following script works great:

for wheel in *.whl do
    pip install $wheel
done

I'm sure similar syntax could be used for Powershell.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
  • OK Thanks for your answer. Is there a way to tell the pip to look for any dependencies of a package being installed, in the wheels directory? – DevLoverUmar Sep 17 '20 at 20:41
  • As the second problem is, if a whl package have some dependencies, pip look for online packages but my machine don't have an internet connection(it's a remote PC), but all the dependencies are present in wheels folder. – DevLoverUmar Sep 17 '20 at 20:43
  • 1
    @DevLoverUmar check out the [`pip` documentation](https://pip.pypa.io). It has a ton of options, and I'm pretty sure there's a way to do what you want to do. – MattDMo Sep 17 '20 at 20:48