昨天遇到了一个python模块安装的问题,要将python包安装到一个指定文件夹中,原来想的是直接创建一个新的python环境,pip3 install scikit-image 后将site-packages中的文件全部拷贝到文件夹中。但是在之后调用该文件夹中的包时出现了报错。
run error : cannot import name 'geometry'
It seems that scikit-image has not been built correctly.
Your install of scikit-image appears to be broken.
Try re-installing the package following the instructions at:
https://scikit-image.org/docs/stable/install.html
在查找了相关资料后发现了这样一段代码:
pip3 install scikit-image --target=文件夹路径 --upgrade
添加--target可以将模块安装到指定路径,解决了部分模块存在依赖的难题。