2

so i got this problem when I try to: import win32api on my Pycharm project.py code. I got this error: Non-zero exit code (1)

I also tried with pypiwin32 and I still got the same error.

What is strange is when I executed the pip install pypiwin32 command on my CMD the instalation of pypiwin32 worked. But it still doesnt work on Pycharm. Thanks for the help

enter image description here

enter image description here

tiberhockey
  • 576
  • 5
  • 22

1 Answers1

3

Looks like you're having trouble finding the win32api module.

Don't worry. I will help you solve this issue.

First, if you are using virtualenv, please make sure you have activated your environment.

If you don't know how to activate, please refer these links below:

Second, when you create the project, please choose New environment using Virtualenv.

Then select Inherit global site-packages and Make available to all projects and press Create button.

This is a screensnap for reference.

enter image description here

Third, you need to edit configuartions.

Like this screensnap shows below, you need to choose .py file by selecting Script Path.

enter image description here

Finally, after everything is configured, it can work well.

enter image description here

Strive Sun
  • 5,988
  • 1
  • 9
  • 26