4

I'm new IT and programming; I been struggling to install mod_wsgi with pip

Example in cmd:

pip install mod_wsgi

I been trying to lunch my django project on my own pc acting as a server

I'm using Apcache 24 and my PC is windows 10, 64bits

My python is 3.7.1 and Django is 2.1.3

Solution I had try:

  1. https://stackoverflow.com/a/42323871/10865416

error:

error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

I had check and and intsall the C++ 14 here the link where I download: https://www.microsoft.com/en-gb/download/details.aspx?id=48145

  1. download and install manually
    https://github.com/sammchardy/python-binance/issues/148#issuecomment-374853521

error:

C:\Users\user>pip install C:/mod_wsgi-4.5.24+ap24vc14-cp37-cp37m-win_amd64.rar
Invalid requirement: 'C:/mod_wsgi-4.5.24+ap24vc14-cp37-cp37m-win_amd64.rar'
Traceback (most recent call last):
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\packaging\requirements.py", line 93, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\pyparsing.py", line 1654, in parseString
    raise exc
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\pyparsing.py", line 1644, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\pyparsing.py", line 1402, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\pyparsing.py", line 3417, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\pyparsing.py", line 1406, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\pyparsing.py", line 3205, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 1), (line:1, col:2)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\req\constructors.py", line 253, in install_req_from_line
    req = Requirement(req)
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\packaging\requirements.py", line 96, in __init__
    requirement_string[e.loc:e.loc + 8], e.msg
pip._vendor.packaging.requirements.InvalidRequirement: Parse error at "':/mod_ws'": Expected stringEnd
  1. https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/win32/README.rst

error:

    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86\\link.exe' failed with exit status 1120

    ----------------------------------------
Command "c:\users\user\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-f9igth3o\\mod-wsgi\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\user\AppData\Local\Temp\pip-record-kmcbksbk\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\user\AppData\Local\Temp\pip-install-f9igth3o\mod-wsgi\

and yes hd VC10 install to had this error, here the link https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017

In advance thank you for your help, apprentice it

I'm a IT Dumb Head
  • 117
  • 1
  • 2
  • 12
  • Number 2 is telling you that the file does not exist. Did you download it and place it in that location? – Daniel Roseman Jan 09 '19 at 10:54
  • Could be wrong, but that filename on Number 2, looks like it has a typo on it, can You double check that? – NeoVe Jan 09 '19 at 10:57
  • Who am I to give advice, but please use Unix systems. It will save a lot of time. – funnydman Jan 09 '19 at 11:18
  • The download page above points not to Visual C++ but only to Redistributable packages. They install run-time libraries that are used to run applications written with VC. But you need Visual C++ compiler! Install [Build Tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017). See https://stackoverflow.com/search?q=%5Bpip%5D+Microsoft+Visual+C%2B%2B+14.0+is+required – phd Jan 09 '19 at 13:45
  • so the third method is also not the builds tools? here the link:https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017 – I'm a IT Dumb Head Jan 10 '19 at 04:00

3 Answers3

4
  1. Some of the pip packages are downloaded as source code, then compiled on the user pc and installed, to compile certain packages different c++ libraries and header files are required, which comes with Microsoft Visual C++ 14.0 package. You have installed Visual C++ Redistributable for Visual Studio 2015, which installs run-time components that are required to run C++ applications built using Visual Studio 2015, not compiler libraries which are required to compile from source. You have to install Visual Studio C++ packages, From this link Visual studio.

  2. Your python version is 3.7.1, you are trying to install mod_wsgi-4.5.24+ap24vc14-cp35-cp35m-wind_amd64.whl which is compiled to work for python version 3.5, on Windows x86_64 arch, not compatible for your system.

  3. Again, required C++ libraries not found in your system.

arryph
  • 2,725
  • 10
  • 15
  • Hi arryph I follow the link and install the visual studio, but again, it can't find the required C++ libraries, now I'm lost on where to even find the installation software for VC – I'm a IT Dumb Head Jan 10 '19 at 04:07
2

Hi I've been struggling with the same issue lately, the way I found to overcome it was to download Microsoft Visual studio, and then start a new C++ project. MVS will download the required components to compile mod_wsgi and everything should be fine after that

Hope it helps

Theophile
  • 105
  • 1
  • 1
  • 8
  • I'm not really sure what you mean but, I tried I open MVS and open new C++ project, then I went back cmd to and pip install mod_wsgi, But I still had same error in 3 – I'm a IT Dumb Head Jan 10 '19 at 07:19
1

Now I really feel very silly;

I figure out why the system install mod_wsgi 64bits because my python is in 32 bits.

but thank you so much on helping me, lead me to solve my problem both ubisun and arryph

I'm a IT Dumb Head
  • 117
  • 1
  • 2
  • 12