简体   繁体   中英

Error while installing Django-channels on Python 3.5 on Windows

I'm also getting the same error while installing Twisted .

Here's version info:

  • Django : 1.9
  • Python : 3.5
  • Trying to install latest version of Django-channels
  • Command used : pip install channels

The error :

running build_ext
building 'twisted.test.raiser' extension error: [WinError 2] The system cannot find the file specified

(Almost) full error message

.......pip install channels
Collecting channels
  Using cached channels-1.1.8-py2.py3-none-any.whl
Collecting daphne~=1.3 (from channels)
  Using cached daphne-1.3.0-py2.py3-none-any.whl
Requirement already satisfied: asgiref~=1.1 in g:\django\projectChat\venv\lib\site-packages (from channels
)
Requirement already satisfied: Django>=1.8 in g:\django\projectChat\venv\lib\site-packages (from channels)

Requirement already satisfied: autobahn>=0.18 in g:\django\projectChat\venv\lib\site-packages (from daphne
~=1.3->channels)
Collecting twisted>=17.1 (from daphne~=1.3->channels)
  Using cached Twisted-17.9.0.tar.bz2
Requirement already satisfied: six in g:\django\projectChat\venv\lib\site-packages (from asgiref~=1.1->cha
nnels)
Requirement already satisfied: txaio>=2.7.0 in g:\django\projectChat\venv\lib\site-packages (from autobahn
>=0.18->daphne~=1.3->channels)
Requirement already satisfied: zope.interface>=4.0.2 in g:\django\projectChat\venv\lib\site-packages (from
 twisted>=17.1->daphne~=1.3->channels)
Requirement already satisfied: constantly>=15.1 in g:\django\projectChat\venv\lib\site-packages (from twis
ted>=17.1->daphne~=1.3->channels)
Requirement already satisfied: incremental>=16.10.1 in g:\django\projectChat\venv\lib\site-packages (from
twisted>=17.1->daphne~=1.3->channels)
Requirement already satisfied: Automat>=0.3.0 in g:\django\projectChat\venv\lib\site-packages (from twiste
d>=17.1->daphne~=1.3->channels)
Requirement already satisfied: hyperlink>=17.1.1 in g:\django\projectChat\venv\lib\site-packages (from twi
sted>=17.1->daphne~=1.3->channels)
Requirement already satisfied: setuptools in g:\django\projectChat\venv\lib\site-packages (from zope.inter
face>=4.0.2->twisted>=17.1->daphne~=1.3->channels)
Requirement already satisfied: attrs in g:\django\projectChat\venv\lib\site-packages (from Automat>=0.3.0-
>twisted>=17.1->daphne~=1.3->channels)
Installing collected packages: twisted, daphne, channels
  Running setup.py install for twisted ... error
    Complete output from command G:\django\projectChat\venv\Scripts\python.exe -u -c "import setuptools, t
okenize;__file__='C:\\Users\\Mike\\AppData\\Local\\Temp\\pip-build-ngnwgsvg\\twisted\\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:\Use
rs\Mike\AppData\Local\Temp\pip-y5sbi03u-record\install-record.txt --single-version-externally-managed --compile --install-
headers G:\django\projectChat\venv\include\site\python3.5\twisted:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.5
    creating build\lib.win-amd64-3.5\twisted
    copying src\twisted\copyright.py -> build\lib.win-amd64-3.5\twisted
    copying src\twisted\plugin.py -> build\lib.win-amd64-3.5\twisted
    copying src\twisted\_version.py -> build\lib.win-amd64-3.5\twisted
    copying src\twisted\__init__.py -> build\lib.win-amd64-3.5\twisted
    copying src\twisted\__main__.py -> build\lib.win-amd64-3.5\twisted
    creating build\lib.win-amd64-3.5\twisted\application
    copying src\twisted\application\app.py -> build\lib.win-amd64-3.5\twisted\application
    copying src\twisted\application\internet.py -> build\lib.win-amd64-3.5\twisted\application
    copying src\twisted\application\reactors.py -> build\lib.win-amd64-3.5\twisted\application
    copying src\twisted\application\service.py -> build\lib.win-amd64-3.5\twisted\application
    copying src\twisted\application\strports.py -> build\lib.win-amd64-3.5\twisted\application
    copying src\twisted\application\__init__.py -> build\lib.win-amd64-3.5\twisted\application
    creating build\lib.win-amd64-3.5\twisted\conch
    copying src\twisted\conch\avatar.py -> build\lib.win-amd64-3.5\twisted\conch
    [...]
    creating build\lib.win-amd64-3.5\twisted\_threads\test
    copying src\twisted\_threads\test\test_convenience.py -> build\lib.win-amd64-3.5\twisted\_threads\test
    copying src\twisted\_threads\test\test_memory.py -> build\lib.win-amd64-3.5\twisted\_threads\test
    copying src\twisted\_threads\test\test_team.py -> build\lib.win-amd64-3.5\twisted\_threads\test
    copying src\twisted\_threads\test\test_threadworker.py -> build\lib.win-amd64-3.5\twisted\_threads\test
    copying src\twisted\_threads\test\__init__.py -> build\lib.win-amd64-3.5\twisted\_threads\test
    running egg_info
    writing dependency_links to src\Twisted.egg-info\dependency_links.txt
    writing entry points to src\Twisted.egg-info\entry_points.txt
    writing src\Twisted.egg-info\PKG-INFO
    writing top-level names to src\Twisted.egg-info\top_level.txt
    writing requirements to src\Twisted.egg-info\requires.txt
    reading manifest file 'src\Twisted.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files matching '*.misc' found under directory 'src\twisted'
    warning: no previously-included files matching '*.bugfix' found under directory 'src\twisted'
    warning: no previously-included files matching '*.doc' found under directory 'src\twisted'
    warning: no previously-included files matching '*.feature' found under directory 'src\twisted'
    warning: no previously-included files matching '*.removal' found under directory 'src\twisted'
    warning: no previously-included files matching 'NEWS' found under directory 'src\twisted'
    warning: no previously-included files matching 'README' found under directory 'src\twisted'
    warning: no previously-included files matching 'newsfragments' found under directory 'src\twisted'
    warning: no previously-included files found matching 'src\twisted\topfiles\CREDITS'
    warning: no previously-included files found matching 'src\twisted\topfiles\ChangeLog.Old'
    warning: no previously-included files found matching 'pyproject.toml'
    warning: no previously-included files found matching 'codecov.yml'
    warning: no previously-included files found matching 'appveyor.yml'
    no previously-included directories found matching 'bin'
    no previously-included directories found matching 'admin'
    no previously-included directories found matching '.travis'
    warning: no previously-included files found matching 'docs\historic\2003'
    warning: no previously-included files matching '*' found under directory 'docs\historic\2003'
    writing manifest file 'src\Twisted.egg-info\SOURCES.txt'
    copying src\twisted\python\_sendmsg.c -> build\lib.win-amd64-3.5\twisted\python
    copying src\twisted\python\twisted-completion.zsh -> build\lib.win-amd64-3.5\twisted\python
    creating build\lib.win-amd64-3.5\twisted\python\_pydoctortemplates
    copying src\twisted\python\_pydoctortemplates\common.html -> build\lib.win-amd64-3.5\twisted\python\_pydoctortemplates
    copying src\twisted\python\_pydoctortemplates\index.html -> build\lib.win-amd64-3.5\twisted\python\_pydoctortemplates
    copying src\twisted\python\_pydoctortemplates\summary.html -> build\lib.win-amd64-3.5\twisted\python\_pydoctortemplates
    copying src\twisted\test\cert.pem.no_trailing_newline -> build\lib.win-amd64-3.5\twisted\test
    copying src\twisted\test\key.pem.no_trailing_newline -> build\lib.win-amd64-3.5\twisted\test
    copying src\twisted\test\raiser.c -> build\lib.win-amd64-3.5\twisted\test
    copying src\twisted\test\raiser.pyx -> build\lib.win-amd64-3.5\twisted\test
    copying src\twisted\test\server.pem -> build\lib.win-amd64-3.5\twisted\test
    copying src\twisted\internet\iocpreactor\build.bat -> build\lib.win-amd64-3.5\twisted\internet\iocpreactor
    copying src\twisted\internet\iocpreactor\notes.txt -> build\lib.win-amd64-3.5\twisted\internet\iocpreactor
    creating build\lib.win-amd64-3.5\twisted\internet\iocpreactor\iocpsupport
    copying src\twisted\internet\iocpreactor\iocpsupport\acceptex.pxi -> build\lib.win-amd64-3.5\twisted\internet\iocpreactor\
iocpsupport
    copying src\twisted\internet\iocpreactor\iocpsupport\connectex.pxi -> build\lib.win-amd64-3.5\twisted\internet\iocpreactor
\iocpsupport
    copying src\twisted\internet\iocpreactor\iocpsupport\iocpsupport.c -> build\lib.win-amd64-3.5\twisted\internet\iocpreactor
\iocpsupport
    copying src\twisted\internet\iocpreactor\iocpsupport\iocpsupport.pyx -> build\lib.win-amd64-3.5\twisted\internet\iocpreact
or\iocpsupport
    copying src\twisted\internet\iocpreactor\iocpsupport\winsock_pointers.c -> build\lib.win-amd64-3.5\twisted\internet\iocpre
actor\iocpsupport
    copying src\twisted\internet\iocpreactor\iocpsupport\winsock_pointers.h -> build\lib.win-amd64-3.5\twisted\internet\iocpre
actor\iocpsupport
    copying src\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi -> build\lib.win-amd64-3.5\twisted\internet\iocpreactor\i
ocpsupport
    copying src\twisted\internet\iocpreactor\iocpsupport\wsasend.pxi -> build\lib.win-amd64-3.5\twisted\internet\iocpreactor\i
ocpsupport
    copying src\twisted\internet\test\_awaittests.py.3only -> build\lib.win-amd64-3.5\twisted\internet\test
    copying src\twisted\internet\test\_yieldfromtests.py.3only -> build\lib.win-amd64-3.5\twisted\internet\test
    creating build\lib.win-amd64-3.5\twisted\internet\test\fake_CAs
    copying src\twisted\internet\test\fake_CAs\chain.pem -> build\lib.win-amd64-3.5\twisted\internet\test\fake_CAs
    copying src\twisted\internet\test\fake_CAs\not-a-certificate -> build\lib.win-amd64-3.5\twisted\internet\test\fake_CAs
    copying src\twisted\internet\test\fake_CAs\thing1.pem -> build\lib.win-amd64-3.5\twisted\internet\test\fake_CAs
    copying src\twisted\internet\test\fake_CAs\thing2-duplicate.pem -> build\lib.win-amd64-3.5\twisted\internet\test\fake_CAs
    copying src\twisted\internet\test\fake_CAs\thing2.pem -> build\lib.win-amd64-3.5\twisted\internet\test\fake_CAs
    copying src\twisted\mail\test\rfc822.message -> build\lib.win-amd64-3.5\twisted\mail\test
    copying src\twisted\python\test\_deprecatetests.py.3only -> build\lib.win-amd64-3.5\twisted\python\test
    copying src\twisted\words\im\instancemessenger.glade -> build\lib.win-amd64-3.5\twisted\words\im
    copying src\twisted\words\xish\xpathparser.g -> build\lib.win-amd64-3.5\twisted\words\xish
    running build_ext
    building 'twisted.test.raiser' extension
    error: [WinError 2] The system cannot find the file specified

    ----------------------------------------
Command "G:\django\projectChat\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Us
ers\\Mike\\AppData\\Local\\Temp\\pip-build-ngnwgsvg\\twisted\\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\Mike\AppData\Loca
l\Temp\pip-y5sbi03u-record\install-record.txt --single-version-externally-managed --compile --install-headers G:\django\projectChat\venv\include\site\python3.5\twisted" failed with error code 1 in C:\Users\Mike\AppData\Local\Tem
p\pip-build-ngnwgsvg\twisted\

I don't know what i'm missing, could someone help me please, thanks.

You need a working C compiler to install Twisted on platforms for which wheels are not provided. There is no Python 3.5 wheel on PyPI for Twisted (at this time). So you need a working C compiler.

Follow these instructions for installing VS2015 to get a working C compiler so Twisted can build the necessary extension modules and install successfully.

The problem is not regarding the need for Visual C++ 14.0 or whatsoever. It is concerned with the installation of Twisted. I was able to fix this problem after trying for weeks together. To install the correct version of Twisted visit this link . (Found this on a similar question's answer, I'm not sure of the writer to give rightful credits). The above-mentioned link displays several versions of Twisted. You should download the one corresponding to your python version. For instance, if your python version is 3.5, you should proceed with downloading cp35m-win32.whl (For Windows only) and so forth. Further, open Command prompt, go to the downloaded path activate your virtual environment and pip install the downloaded file. This shall fix your issue.

I had a similar problem... I was only able to fix it by downloading Visual Studio Build tools and installing the Visual C++ Build Tools, Windows 10 SDK, and VC++ 2015.3 v14

在此处输入图片说明

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM