title: Pycharm: DLL load failed: The specified procedure could not be found
body: <p>I am working on a Python project in Pycharm (<code>2020.1.2</code>) on Windows 10.</p>
  
  <p>For this project, I cannot use the standard Python interpreter, I have to use my own located at <code>C:\some\path\here\python\27_64\python.exe</code> (Python 2.7.3).</p>
  
  <p>Backstory may be important:</p>
  
  <p>I have added this path to the system path for both myself and all users, and placed it ahead of <code>%LOCALAPPDATA%\Microsoft\WindowsApps</code> to try to prevent the Microsoft store from popping up whenever I try to run <code>python</code> on the command line - however I don't feel like this change to the path variable has made a difference, as the Microsoft store still pops up.</p>
  
  <p>I <strong>can</strong> start a Python shell by running <code>C:\some\path\here\python\27_64\python.exe</code>, so I know it technically works. When I do so; the <code>sys.path</code> is as follows:</p>
  
  <pre><code>['', 'C:\\another_place\\Python_2.7.3_x64\\python27.zip',
  'C:\\some\\path\\here\\python\\27_64\\DLLs',
  'C:\\some\\path\\here\\python\\27_64\\lib',
  'C:\\some\\path\\here\\python\\27_64\\lib\\plat-win',
  'C:\\some\\path\\here\\python\\27_64\\lib\\lib-tk',
  'C:\\some\\path\\here\\python\\27_64',
  'C:\\some\\path\\here\\python\\27_64\\lib\\site-packages']
  </code></pre>
  
  <p>Anyway, when I try to run a Python console (not even my script), this is the message I get in Pycharm:</p>
  
  <pre><code>C:\some\path\here\python\27_64\python.exe "C:\Program Files\JetBrains\PyCharm 2020.1.1\plugins\python\helpers\pydev\pydevconsole.py" --mode=client --port=59771
  Traceback (most recent call last):
    File "C:\Program Files\JetBrains\PyCharm 2020.1.1\plugins\python\helpers\pydev\pydevconsole.py", line 5, in &lt;module&gt;
      from _pydev_comm.pydev_rpc import make_rpc_client, start_rpc_server, start_rpc_server_and_make_client
    File "C:\Program Files\JetBrains\PyCharm 2020.1.1\plugins\python\helpers\pydev\_pydev_comm\pydev_rpc.py", line 1, in &lt;module&gt;
      import socket
    File "C:\some\path\here\python\27_64\lib\socket.py", line 47, in &lt;module&gt;
      import _socket
  ImportError: DLL load failed: The specified procedure could not be found.
  Process finished with exit code 1
  </code></pre>
  
  <p>I have gone to <code>Settings</code>><code>Project:[name]</code>><code>Project Interpreter</code> and set it to <code>C:\some\path\here\python\27_64\python.exe</code> (and rebooted Pycharm to be sure). That said; in the settings window no packages are shown and it claims that Python packaging tools can not be found.
  <a href="https://i.stack.imgur.com/IkBXL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/IkBXL.png" alt="picture of Pycharm settings window, the file path is to the interpreter is C:\some\path\here\python\27_64\python.exe, a message says the Python packaging tools can&#39;t be found, the link &quot;install packages&quot; is circled in red"></a>
  When I click the link to install them (circled in red), they can not be installed due to this error:</p>
  
  <pre><code>ImportError: cannot import name _remove_dead_weakref
  </code></pre>
  
  <p>Are there other variables or settings I need to change?</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Uninstalling the first Python on my Path (<code>C:\\another_place\\Python_2.7.3_x64\\python27.zip</code>) just makes everything so much worse</p>
  
  <p><strong>EDIT 2</strong>
  I added the <code>PATH</code> variable manually to both the Python console settings and to the Run/Debug settings in PyCharm (and restarted the program), the result is still the same</p>