23

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.

BantuCoder
  • 251
  • 1
  • 2
  • 8

4 Answers4

31

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.

Velociraptors
  • 2,012
  • 16
  • 22
13

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>
Niko Föhr
  • 28,336
  • 10
  • 93
  • 96
  • 1
    Thank you - I found this from Google also, along with several other threads suggesting to run 2to3 or something similar, but my project was already using Python 3 when the problem started! This is simple and solved the problem. Thanks! – chris Apr 12 '18 at 20:30
  • It seems one may overwrite the virtual environment by running `python -m venv ORIGINAL/PATH`, this clobbers the files in the venv with newer ones so you may at least run `pip freeze` before wiping the folder. Then I'd follow the steps above. – Carel Oct 17 '18 at 21:17
0

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.

Chikku Jacob
  • 2,114
  • 1
  • 18
  • 33
0

When you encounter an error like module of simpleai not found, use

pip install simpleai

in the prompt and then execute. It will get installed.

Kevin
  • 16,549
  • 8
  • 60
  • 74