[英]Can I copy and paste software packages from my old Python 3.6.3 to the /Lib/site-packages directory of a newly installed Python 3.7.4?
I want to have the same packages installed on the new version of Python (3.7.4) which I just installed as I do in my old version of Python (3.6.3) such as: Numpy, pandas, opencv, mathplotlib, etc, etc. 我想在新版本的Python(3.7.4)上安装与我在旧版本的Python(3.6.3)中安装的软件包相同的软件包,例如:Numpy,pandas,opencv,mathplotlib等,等等
Is there an quick & easy way of doing this? 有快速简便的方法吗?
Can I just copy and paste the packages from python36/Lib/site-packages to python37/Lib/site-packages or do I have to use 'pip install' to do it manually for each package? 我可以仅将软件包从python36 / Lib / site-packages复制并粘贴到python37 / Lib / site-packages,还是必须使用“ pip install”手动为每个软件包进行安装?
You can but they will not work. 您可以,但是它们将无法工作。 Especially packages such as numpy, pandas, matplotlib, opencv etc. They need to be compiled for a specific target.
特别是诸如numpy,pandas,matplotlib,opencv等软件包。它们需要针对特定目标进行编译。 If you want the exact same packages in 3.7,
pip freeze
will list all installed packages. 如果要使用3.7中完全相同的软件包,则
pip freeze
将列出所有已安装的软件包。 Store the output in a file and then use the pip in python 3.7 to install them pip3.7 install -r output_of_pip_freeze.txt
将输出存储在文件中,然后在python 3.7中使用pip进行安装
pip3.7 install -r output_of_pip_freeze.txt
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.