简体   繁体   English

导入 python pydriller 模块在 venv 中不起作用

[英]Importing python pydriller module doesn't work in venv

I'm trying to import pydriller using python interpreter in venv, after installing pydriller with pip I try the following:我正在尝试使用 venv 中的 python 解释器导入 pydriller,在使用 pip 安装 pydriller 之后,我尝试以下操作:

from pydriller import RepositoryMining

but the IDE can't recognize "RepositoryMining" and I'm getting this error:但 IDE 无法识别“RepositoryMining”,我收到此错误:

cannot import name 'RepositoryMining' from partially initialized module 'pydriller' (most likely due to a circular import)无法从部分初始化的模块“pydriller”导入名称“RepositoryMining”(很可能是由于循环导入)

Although I can see in the "venv" the "pydriller" folder which contains a file with the class "RepositoryMining",虽然我可以在“venv”中看到“pydriller”文件夹,其中包含一个带有 class“RepositoryMining”的文件,

And after that said, I tried to install pydriller on the system (without venv) and it worked, but the problem is that I need it to be working in the project with the virtual environment, any suggestions on how to fix it?在那之后,我尝试在系统上安装pydriller(没有venv)并且它工作,但问题是我需要它在虚拟环境的项目中工作,关于如何修复它的任何建议?

The problem was that my python file name was "pydriller.py", I needed to rename it to avoid import conflicts (hoping that this will help someone).问题是我的 python 文件名是“pydriller.py”,我需要重命名它以避免导入冲突(希望这会对某人有所帮助)。

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

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