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

How to setup the development environment in Pycharm on windows? (ImportError: cannot import name 'open' from 'builtins' (unknown location)) #32

Open
alexiscatnip opened this issue Jun 24, 2022 · 6 comments

Comments

@alexiscatnip
Copy link

In windows,
In pycharm,
I configured the project to run in anaconda env with python 3.7:

Error log:


C:\Users\Alexis\anaconda3\envs\multical_py37\python.exe C:/workspace/multical/multical/app/multical.py
Fatal Python error: init_sys_streams: can't initialize sys standard streams
Traceback (most recent call last):
  File "C:\workspace\multical\multical\io\__init__.py", line 1, in <module>
  File "C:\workspace\multical\multical\io\detections.py", line 3, in <module>
  File "C:\workspace\multical\multical\__init__.py", line 1, in <module>
  File "C:\workspace\multical\multical\board\__init__.py", line 1, in <module>
  File "C:\Users\Alexis\anaconda3\envs\multical_py37\lib\dataclasses.py", line 5, in <module>
  File "C:\Users\Alexis\anaconda3\envs\multical_py37\lib\inspect.py", line 40, in <module>
  File "C:\Users\Alexis\anaconda3\envs\multical_py37\lib\linecache.py", line 11, in <module>
  File "C:\Users\Alexis\anaconda3\envs\multical_py37\lib\tokenize.py", line 27, in <module>
ImportError: cannot import name 'open' from 'builtins' (unknown location)
@alexiscatnip
Copy link
Author

1 can be run from CMD prompt:

  1. cd to repo root:
    cd C:\workspace\multical
  2. call python on the main file
    python multical/app/multical_main.py

2 When called in such a way, this issue arises:
https://stackoverflow.com/questions/54333865/python-no-module-named-error-package-is-not-a-package?answertab=trending#tab-top

To fix that, you can rename multical.py -> multical_main.py

@yetniek
Copy link

yetniek commented Apr 17, 2023

Are you solved this problem?
I fixed the file name multical.py -> multical_main.py (and same environments setting with you),
but its not solved.

@oliver-batchelor
Copy link
Owner

oliver-batchelor commented Apr 17, 2023 via email

@yetniek
Copy link

yetniek commented Apr 17, 2023

In Anaconda, I created a virtual environment with Python 3.7, I used pycharm.
I installed the package with pip install multical.
But the error keeps popping up.
Do you happen to know how?

@oliver-batchelor
Copy link
Owner

oliver-batchelor commented Apr 17, 2023 via email

@yetniek
Copy link

yetniek commented Apr 17, 2023

ok i'll try.
Thank you so much for the speedy reply.

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

3 participants