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

导入包报错,文件夹重名导致的坑 #140

Open
nlwify opened this issue Nov 1, 2023 · 3 comments
Open

导入包报错,文件夹重名导致的坑 #140

nlwify opened this issue Nov 1, 2023 · 3 comments

Comments

@nlwify
Copy link

nlwify commented Nov 1, 2023

在Linux服务器运行时,在导入包from datasets.dataset_synapse import Synapse_dataset, RandomGenerator的时候报错。因为datasets文件夹与python自带的site-packages里的datasets重名

@979591
Copy link

979591 commented Mar 6, 2024

请问怎么解决呢

@sanctuary-sun
Copy link

在datasets文件夹下新建一个空白的__init__.py文件

@Kyochilian
Copy link

请问怎么解决呢

如果是在Pycharm中,将该文件夹设为源文件。如果 在vscode中,在该文件夹下创建一个新的__init__.py文件即可

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

4 participants