importError: no module named _winreg python3

巧了我就是萌 提交于 2019-12-30 07:53:28

问题


Where can I download _winreg for python3 if I can at all. I have my 'windir' on E:\Windows. I do not know if cx_Freeze did not notice that. I am using cx_Freeze to create an msi installer.


回答1:


As it says in the _winreg documentation, it has been renamed to winreg in Python 3.0. You should run the 2to3 tool if you're converting code that was written for Python 2.x.




回答2:


I know this is an old question, but this was the first search result when Googling for ModuleNotFoundError: No module named '_winreg', and perhaps may be helpful for someone.

I got the same error when trying to use a virtual environment folder, which has been created using different (already deleted) python binaries. The solution was recreate the virtual environment:

  1. Delete the virtual environment folder
  2. Run python -m venv <name_of_virtual_environment>



回答3:


I have found an easy solution for this, Even though i found it after a lot of Rnd, the solution implementation is so simple and straight forward. Hope it can help many people with the same problem.

If you dont have the latest version of Python installed on your machine, You need to download it from (https://www.python.org/downloads/) and then click on Add to path option and just finish the installer.

Please open CMD and move to the python latest version directory, then run the pip install package name (e.g) pip install pygame and it will be successful

1. C:\WINDOWS\system32>cd C:\Users\admin\AppData\Local\Programs\Python\Python37-32

    2. C:\Users\admin\AppData\Local\Programs\Python\Python37-32>pip install Pygame 

It will install the packages now without any issues.

Downloading Successfully installed Pygame-1.9.4

C:\Users\admin\AppData\Local\Programs\Python\Python37-32>

If you are still facing issues in Pycharm after trying the above solution, please try the following steps too.

  1. Create new virtual Environment from settings menu and select the latest version of python framework as Project Interpreter and give a new folder path.

  2. select the pip package you want to import. Recompile the code and the error will clear.

Hope this helps.




回答4:


when you encounter a error like module of simpleai not found use the " pip install simpleai " in prompt and then execute it will get installed



来源:https://stackoverflow.com/questions/4320761/importerror-no-module-named-winreg-python3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!