Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pillow需要Library的内容,怎么吧Library添加到PyStand中 #35

Open
ylluX opened this issue Jan 10, 2023 · 3 comments
Open

pillow需要Library的内容,怎么吧Library添加到PyStand中 #35

ylluX opened this issue Jan 10, 2023 · 3 comments

Comments

@ylluX
Copy link

ylluX commented Jan 10, 2023

将PIL拷贝到PyStand,执行程序后,提示:
from PIL import Image
File "D:\PyStand\site-packages\PIL\Image.py", line 89, in
from . import _imaging as core
ImportError: DLL load failed while importing _imaging: 找不到指定的模块。

研究后发现,原始的虚拟环境中Lib/site-packages/PIL依赖Library/include, 根据教程,把PIL拷贝到PyStand/site-packages,那么Library拷贝到哪儿呢?

@skywind3000
Copy link
Owner

按照相对路径拷贝

@ylluX
Copy link
Author

ylluX commented Jan 11, 2023

miniconda虚拟环境相对路径如下:
miniconda
|__ envs
.......|__ my_env
..............|__ python.exe
..............|__ Lib
..............|.....|__ site-packages
..............|...........|__ PIL
..............|__ Library # PIL依赖这个目录下的一些文件
....................|__ bin
....................|__ include
....................|__ lib
....................|__ ssl

PyStand的目录结构如下:
PyStand
|__ runtime
|.....|__ python.exe
|__ site-packages

按照教程,把miniconda/envs/my_env/Lib/site-packages/PIL拷贝到PyStand/site-packages/中,那么miniconda/envs/my_env/Library拷贝到哪个路径下呢?
“按照相对路径拷贝”是相应与谁呢?是PyStand/runtime/python.exe还是相对于PyStand/site-packages/PIL呢,前者我试了不行,后者的话相对路径已经跑出PyStand项目之外了。

@ylluX
Copy link
Author

ylluX commented Jan 11, 2023

问题解决了,用conda安装的PIL,无法直接拷贝过来使用,但用pip安装的可以。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants