在python中将文件夹作为包导入

吉姆陈

我使用的是 linux 服务器,但我没有安装包的权限pip,所以我下载了我需要的包:tsfreshhttps://github.com/blue-yonder/tsfresh,然后使用ftp上传解压的文件夹我下载到Linux服务器,但我该怎么做import tsfresh??

我把下载文件夹放在路径中/upload/tsfresh,我的python工作目录在/upload/.

以下是我的文件夹的子文件夹 upload

./tsfresh
./tsfresh/.github
./tsfresh/binder
./tsfresh/docs
./tsfresh/notebooks
./tsfresh/tests
./tsfresh/tsfresh
./tsfresh/docs/api
./tsfresh/docs/images
./tsfresh/docs/text
./tsfresh/docs/_static
./tsfresh/docs/_templates
./tsfresh/tests/integrations
./tsfresh/tests/units
./tsfresh/tests/integrations/examples
./tsfresh/tests/units/feature_extraction
./tsfresh/tests/units/feature_selection
./tsfresh/tests/units/scripts
./tsfresh/tests/units/transformers
./tsfresh/tests/units/utilities
./tsfresh/tsfresh/convenience
./tsfresh/tsfresh/examples
./tsfresh/tsfresh/feature_extraction
./tsfresh/tsfresh/feature_selection
./tsfresh/tsfresh/scripts
./tsfresh/tsfresh/transformers
./tsfresh/tsfresh/utilities

我的问题是:如何将其tsfresh作为普通包导入

亚历克斯·韦弗斯

它在您的项目文件夹中,对吗?然后

import tsfresh

如果它有一个init.py使其成为模块,它将起作用

如果它不在该文件夹中,请将其附加到 sys.path

或者让您的管理员安装它。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Python打包:了解根文件夹,从包文件导入,

来自分类Dev

Python无法在相同的文件夹结构中导入包

来自分类Dev

如何从文件夹导入python文件

来自分类Dev

仅当从已安装的包调用时,从子文件夹导入Python失败

来自分类Dev

从文件夹导入python模块

来自分类Dev

在子文件夹中导入Python

来自分类Dev

从Python中的测试文件夹导入

来自分类Dev

python从子文件夹导入

来自分类Dev

从子文件夹导入javascript程序包

来自分类Dev

在 Python 3 中将文件作为 dict() 导入

来自分类Dev

无法在同级子文件夹之间导入python文件

来自分类Dev

从文件夹Python导入和读取所有文件

来自分类Dev

使用该包在脚本文件夹中创建子文件夹的 Python 包

来自分类Dev

从不同的文件夹导入Python模块

来自分类Dev

从Python中的相邻文件夹导入模块

来自分类Dev

来自更高/其他文件夹的Python导入功能

来自分类Dev

Python-从更深的子文件夹导入

来自分类Dev

从父级的子文件夹导入Python

来自分类Dev

Python导入问题有多个文件夹

来自分类Dev

如何从python的父文件夹导入函数?

来自分类Dev

从不同的文件夹级别导入类-Python

来自分类Dev

Python-将模块导入文件夹之外

来自分类Dev

来自更高/其他文件夹的Python导入功能

来自分类Dev

如何从相邻文件夹中正确导入python模块?

来自分类Dev

Python导入问题有多个文件夹

来自分类Dev

如何从python的父文件夹导入函数?

来自分类Dev

维护 2 个不同的 python 文件夹的导入问题

来自分类Dev

如何制作python导入模块和文件夹?

来自分类Dev

从文件夹导入python模块时出错