简体   繁体   English

如何在没有Internet的情况下安装Python软件包

[英]How to install the Python package without the Internet

There is a python 2.7 build (Python 2.7.14 (default, Jan 16 2018, 16:11:42) [MSC v.1800 64 bit (AMD64)] on win32) with the pip 9.0 and wheel packages installed. 安装了pip 9.0和wheel软件包的python 2.7版本(Python 2.7.14(默认,Jan 16 2018,16:11:42)[MSC v.1800 64位(AMD64)]在win32上)。

Windows 7. No MSVC compiler. Windows7。没有MSVC编译器。 There is no Internet, only a flash drive. 没有互联网,只有闪存驱动器。

Need a package pillow. 需要一个包装枕头。 On the official website there is an egg. 在官方网站上有一个鸡蛋。 I can not install the package - can not find the DLL. 我无法安装软件包-找不到DLL。

What I tried: 我试过的

  1. I tried to unpack egg in the site-packages directory. 我试图在site-packages目录中解包鸡蛋。

  2. python -m pip install "D: \\ ShadowProg \\ Pillow-5.3.0-cp27-cp27m-win_amd64.whl" python -m pip install“ D:\\ ShadowProg \\ Pillow-5.3.0-cp27-cp27m-win_amd64.whl”

I took precompiled wheel from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pillow 我从https://www.lfd.uci.edu/~gohlke/pythonlibs/#pillow拿了预编译的轮子

The error in both cases is the same: 两种情况下的错误是相同的:

from PIL import Image

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

File "C:\FreeCAD 0.17\bin\lib\site-packages\PIL\Image.py", line 64, in

from . import _imaging as core

ImportError: DLL load failed: The specified module could not be found.

Installation without compiler is highly desirable. 非常需要没有编译器的安装。 Please advise what to do? 请告知该怎么办?

Just spent ages with same problem - need to install Twisted on an offline machine with Windows 10. 刚刚经历了同样的问题-需要在Windows 10的脱机计算机上安装Twisted。

Finally what have I done: 最后,我做了什么:

  1. Find another machine with same OS, internet and VC++ (needed to install Twisted) 查找另一台具有相同操作系统,互联网和VC ++的计算机(需要安装Twisted)
  2. Install all needed packages on that machine into virtualenv 将该计算机上所有需要的软件包安装到virtualenv
  3. Copy full virtualenv folder to destination PC 将完整的virtualenv文件夹复制到目标PC

You paths should be exactly the same! 您的路径应该完全相同! If on source machine virtual env was c:\\myproject\\venv , it should remain on destination PC! 如果在源计算机上,虚拟环境是c:\\myproject\\venv ,则它应保留在目标PC上! Otherwise you will need some manual work with fixing paths, which I believe you would prefer to avoid. 否则,您将需要一些固定路径的手动操作,我相信您希望避免。

Also take care - Python versions should be the same. 还请注意-Python版本应该相同。 I failed with 32bit/64bit versions at first 我最初使用32位/ 64位版本失败

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM