5

I uninstalled python3.4 and installed python3.9.2. Now pip is not working. python3 -m pip install is showing following error

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/subprocess.py", line 73, in <module>
    import msvcrt
ModuleNotFoundError: No module named 'msvcrt'

Simple python codes are running. My OS is openSUSE Leap 42.3. I have another python2.7 installed. Any help will be appreciated.

user10340258
  • 339
  • 1
  • 5
  • 15
  • May be is your py3.4 installed this package bug py3.9 is not, so ```cd``` your py3.9's pip dir and install again, or use py3.4 to run your code. – Johnny Mar 26 '21 at 09:57
  • 2
    msvcrt is a windows-only package (msvcrt stands for MicroSoft Visual C RunTime and is typically found as msvcrt.dll on windows systems). – spectras Mar 26 '21 at 09:57
  • @spectras I agree with you but do not understand why this error comes. – user10340258 Mar 26 '21 at 11:14
  • @Johnny py3.4 is no more there. – user10340258 Mar 26 '21 at 11:16
  • 3
    The odd thing is that it does not continue. The expected code flow goes like this: try to load windows-only modules, and then if that fails assume posix. That exception you see is supposed to be caught. – spectras Mar 26 '21 at 12:51
  • Can you find the ```C:\Windows\System32\msvcrt.dll``` file? If not, you need to fix it. – Johnny Mar 29 '21 at 04:05

1 Answers1

4

It was about setting the path

ln -s /usr/local/lib64/python3.9/lib-dynload/ /usr/local/lib/python3.9/lib-dynload

This link was helpful.

user10340258
  • 339
  • 1
  • 5
  • 15