pythonwindowspycharmopenstacksdk

Trouble installing python openstacksdk on Windows machine


I am trying to install the python openstacksdk package via PyCharm (using pip in terminal), but I keep getting the following error message. I only posted a partial error message, I can add the whole message if needed. Any thoughts? I am using a Windows 10 machine.

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\szadro200\PycharmProjects\opentstack_ck> pip install openstacksdk
Collecting openstacksdk
  Using cached openstacksdk-0.61.0-py3-none-any.whl (1.4 MB)
Collecting jmespath>=0.9.0
  Using cached jmespath-0.10.0-py2.py3-none-any.whl (24 kB)
Collecting jsonpatch!=1.20,>=1.16
  Using cached jsonpatch-1.32-py2.py3-none-any.whl (12 kB)
Collecting keystoneauth1>=3.18.0
  Using cached keystoneauth1-4.4.0-py3-none-any.whl (314 kB)
Requirement already satisfied: requestsexceptions>=1.2.0 in c:\users\szadro200\pycharmprojects\opentstack_ck\venv\lib\site-packages (from openstacksdk) (1.4.0)
Requirement already satisfied: decorator>=4.4.1 in c:\users\szadro200\pycharmprojects\opentstack_ck\venv\lib\site-packages (from openstacksdk) (5.1.1)
Collecting munch>=2.1.0
  Using cached munch-2.5.0-py2.py3-none-any.whl (10 kB)
Requirement already satisfied: PyYAML>=3.13 in c:\users\szadro200\pycharmprojects\opentstack_ck\venv\lib\site-packages (from openstacksdk) (6.0)
Collecting cryptography>=2.7
  Using cached cryptography-36.0.1-cp36-abi3-win_amd64.whl (2.2 MB)
Requirement already satisfied: iso8601>=0.1.11 in c:\users\szadro200\pycharmprojects\opentstack_ck\venv\lib\site-packages (from openstacksdk) (1.0.2)
Collecting netifaces>=0.10.4
  Using cached netifaces-0.11.0.tar.gz (30 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: os-service-types>=1.7.0 in c:\users\szadro200\pycharmprojects\opentstack_ck\venv\lib\site-packages (from openstacksdk) (1.7.0)
Collecting appdirs>=1.3.0
  Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Requirement already satisfied: pbr!=2.1.0,>=2.0.0 in c:\users\szadro200\pycharmprojects\opentstack_ck\venv\lib\site-packages (from openstacksdk) (5.8.1)
Collecting dogpile.cache>=0.6.5
  Using cached dogpile.cache-1.1.5-py3-none-any.whl (51 kB)
Requirement already satisfied: cffi>=1.12 in c:\users\szadro200\pycharmprojects\opentstack_ck\venv\lib\site-packages (from cryptography>=2.7->openstacksdk) (1.15.0)
Requirement already satisfied: stevedore>=3.0.0 in c:\users\szadro200\pycharmprojects\opentstack_ck\venv\lib\site-packages (from dogpile.cache>=0.6.5->openstacksdk) (3.5.0)
Requirement already satisfied: jsonpointer>=1.9 in c:\users\szadro200\pycharmprojects\opentstack_ck\venv\lib\site-packages (from jsonpatch!=1.20,>=1.16->openstacksdk) (2.2)
Requirement already satisfied: requests>=2.14.2 in c:\users\szadro200\pycharmprojects\opentstack_ck\venv\lib\site-packages (from keystoneauth1>=3.18.0->openstacksdk) (2.27.1)
Requirement already satisfied: six>=1.10.0 in c:\users\szadro200\pycharmprojects\opentstack_ck\venv\lib\site-packages (from keystoneauth1>=3.18.0->openstacksdk) (1.16.0)
Requirement already satisfied: pycparser in c:\users\szadro200\pycharmprojects\opentstack_ck\venv\lib\site-packages (from cffi>=1.12->cryptography>=2.7->openstacksdk) (2.21)
Requirement already satisfied: idna<4,>=2.5 in c:\users\szadro200\pycharmprojects\opentstack_ck\venv\lib\site-packages (from requests>=2.14.2->keystoneauth1>=3.18.0->openstacksdk) (3.3)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\szadro200\pycharmprojects\opentstack_ck\venv\lib\site-packages (from requests>=2.14.2->keystoneauth1>=3.18.0->openstacksdk) (2.0.12)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\szadro200\pycharmprojects\opentstack_ck\venv\lib\site-packages (from requests>=2.14.2->keystoneauth1>=3.18.0->openstacksdk) (1.26.8)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\szadro200\pycharmprojects\opentstack_ck\venv\lib\site-packages (from requests>=2.14.2->keystoneauth1>=3.18.0->openstacksdk) (2021.10.8)
Building wheels for collected packages: netifaces
  Building wheel for netifaces (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [11 lines of output]
      running bdist_wheel
      running build
      running build_ext
      building 'netifaces' extension
      creating build
      creating build\temp.win-amd64-3.9
      creating build\temp.win-amd64-3.9\Release
      "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DWIN32=1 -DNETIFACES_VERSION=0.11.0 -Ic:\users\szadro200\pycharmprojects\opentstack_ck\venv\include -IC:\Python\Python39\include -IC:\Python\Pyth
on39\Include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETF
XSDK\4.6.1\include\um" /Tcnetifaces.c /Fobuild\temp.win-amd64-3.9\Release\netifaces.obj
      netifaces.c
      c:\python\python39\include\pyconfig.h(200): fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit code 2
      [end of output]

Solution

  • I was finally able to resolve my issue when trying to install openstacksdk in Python either by pip install or PyCharm.

    I had to install Microsoft C++ Build Tools via the following url https://visualstudio.microsoft.com/visual-cpp-build-tools/