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/
Related
so I recently upgraded to Python 3.9 and when trying to install some libraries - specifically pip install discord - I encountered the following error:
ERROR: Command errored out with exit status 1:
command: 'c:\users\user\appdata\local\programs\python\python39\python.exe' 'c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\User\AppData\Local\Temp\tmprrfx0262'
cwd: C:\Users\User\AppData\Local\Temp\pip-install-qj3xz8wb\multidict
Complete output (40 lines):
**********************
* Accellerated build *
**********************
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\multidict
copying multidict\_abc.py -> build\lib.win-amd64-3.9\multidict
copying multidict\_compat.py -> build\lib.win-amd64-3.9\multidict
copying multidict\_multidict_base.py -> build\lib.win-amd64-3.9\multidict
copying multidict\_multidict_py.py -> build\lib.win-amd64-3.9\multidict
copying multidict\__init__.py -> build\lib.win-amd64-3.9\multidict
running egg_info
writing multidict.egg-info\PKG-INFO
writing dependency_links to multidict.egg-info\dependency_links.txt
writing top-level names to multidict.egg-info\top_level.txt
reading manifest file 'multidict.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files found matching 'multidict\_multidict.html'
warning: no previously-included files found matching 'multidict\*.so'
warning: no previously-included files found matching 'multidict\*.pyd'
warning: no previously-included files found matching 'multidict\*.pyd'
no previously-included directories found matching 'docs\_build'
writing manifest file 'multidict.egg-info\SOURCES.txt'
copying multidict\__init__.pyi -> build\lib.win-amd64-3.9\multidict
copying multidict\_multidict.c -> build\lib.win-amd64-3.9\multidict
copying multidict\py.typed -> build\lib.win-amd64-3.9\multidict
creating build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\defs.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\dict.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\istr.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\iter.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\pair_list.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\views.h -> build\lib.win-amd64-3.9\multidict\_multilib
running build_ext
building 'multidict._multidict' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for multidict
Building wheel for yarl (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\user\appdata\local\programs\python\python39\python.exe' 'c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\User\AppData\Local\Temp\tmp_na_hzow'
cwd: C:\Users\User\AppData\Local\Temp\pip-install-qj3xz8wb\yarl
Complete output (35 lines):
**********************
* Accellerated build *
**********************
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\yarl
copying yarl\_quoting.py -> build\lib.win-amd64-3.9\yarl
copying yarl\_quoting_py.py -> build\lib.win-amd64-3.9\yarl
copying yarl\_url.py -> build\lib.win-amd64-3.9\yarl
copying yarl\__init__.py -> build\lib.win-amd64-3.9\yarl
running egg_info
writing yarl.egg-info\PKG-INFO
writing dependency_links to yarl.egg-info\dependency_links.txt
writing requirements to yarl.egg-info\requires.txt
writing top-level names to yarl.egg-info\top_level.txt
reading manifest file 'yarl.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.cache' found anywhere in distribution
warning: no previously-included files found matching 'yarl\*.html'
warning: no previously-included files found matching 'yarl\*.so'
warning: no previously-included files found matching 'yarl\*.pyd'
no previously-included directories found matching 'docs\_build'
writing manifest file 'yarl.egg-info\SOURCES.txt'
copying yarl\__init__.pyi -> build\lib.win-amd64-3.9\yarl
copying yarl\_quoting_c.c -> build\lib.win-amd64-3.9\yarl
copying yarl\_quoting_c.pyi -> build\lib.win-amd64-3.9\yarl
copying yarl\_quoting_c.pyx -> build\lib.win-amd64-3.9\yarl
copying yarl\py.typed -> build\lib.win-amd64-3.9\yarl
running build_ext
building 'yarl._quoting_c' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for yarl
Failed to build multidict yarl
ERROR: Could not build wheels for multidict, yarl which use PEP 517 and cannot be installed directly
Obviously I went to the link and downloaded the build tools and then checked the C++ part but after restarting my computer, re-installing visual studio, I am still encountering the same problem. I am wondering if there is a part in the installation process that I am missing out on or if I have messed something up.
Any help appreciated.
Open up visual studio installer and select modify build tools
Go to individual components and make sure C++ 2019 Redistributable Update, C++ CMake tools for Windows, MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.27), C++ AddressSanitizer (Experimental), C++ Build Tools core features, are checked.
If not check them and select modify. If you are on an ARM or ARM64 based system, replace MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.27) with the ARM or ARM64 version.
Try to install Visual Studio: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16, and Visual Studio C++ Build Tools: https://visualstudio.microsoft.com/visual-cpp-build-tools/. The problem should be fixed.
Make sure you have version 14+.
I think for installing discord api you need to write the command pip install discord.py and not pip install discord
trying to download discord.py using pip install, gave me the error message in the title.
I installed using cmd and the commands py -m pip install -U discord, the cmd was also run in admin.
tried using pip, pip3, and pip3.9, all of which didnt work.
I tried uninstalling/reinstalling/upgrading (in that order) the said libraries:
pip
yarl
multidict
wheel
setuptools
versions of python that I tried (in all versions are downloaded with default settings with nothing changed):
python-3.9.0-amd64.exe
python-3.9.0.exe
I tried researching about wheels and tried installing with --no-binary :all: as well, but it gave the same error message below.
in all the iterations of what I have tried, it churned out the exact same error message without any deviation
ples help :<
Using cached discord-1.0.1-py3-none-any.whl (1.1 kB)
Collecting discord.py>=1.0.1
Using cached discord.py-1.5.1-py3-none-any.whl (701 kB)
Processing c:\users\mt\appdata\local\pip\cache\wheels\b6\9c\bd\6b99bc6ec9dab11f3756d31fb8506d3ecf07aea58b6201f539\aiohttp-3.6.3-py3-none-any.whl
Collecting attrs>=17.3.0
Using cached attrs-20.2.0-py2.py3-none-any.whl (48 kB)
Collecting chardet<4.0,>=2.0
Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting async-timeout<4.0,>=3.0
Using cached async_timeout-3.0.1-py3-none-any.whl (8.2 kB)
Collecting yarl<1.6.0,>=1.0
Using cached yarl-1.5.1.tar.gz (173 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Collecting multidict<5.0,>=4.5
Using cached multidict-4.7.6.tar.gz (50 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Collecting idna>=2.0
Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Building wheels for collected packages: yarl, multidict
Building wheel for yarl (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\mt\appdata\local\programs\python\python39\python.exe' 'c:\users\mt\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\MT\AppData\Local\Temp\tmptlhkh7zi'
cwd: C:\Users\MT\AppData\Local\Temp\pip-install-nztu4nu2\yarl
Complete output (35 lines):
**********************
* Accellerated build *
**********************
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\yarl
copying yarl\_quoting.py -> build\lib.win-amd64-3.9\yarl
copying yarl\_quoting_py.py -> build\lib.win-amd64-3.9\yarl
copying yarl\_url.py -> build\lib.win-amd64-3.9\yarl
copying yarl\__init__.py -> build\lib.win-amd64-3.9\yarl
running egg_info
writing yarl.egg-info\PKG-INFO
writing dependency_links to yarl.egg-info\dependency_links.txt
writing requirements to yarl.egg-info\requires.txt
writing top-level names to yarl.egg-info\top_level.txt
reading manifest file 'yarl.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.cache' found anywhere in distribution
warning: no previously-included files found matching 'yarl\*.html'
warning: no previously-included files found matching 'yarl\*.so'
warning: no previously-included files found matching 'yarl\*.pyd'
no previously-included directories found matching 'docs\_build'
writing manifest file 'yarl.egg-info\SOURCES.txt'
copying yarl\__init__.pyi -> build\lib.win-amd64-3.9\yarl
copying yarl\_quoting_c.c -> build\lib.win-amd64-3.9\yarl
copying yarl\_quoting_c.pyi -> build\lib.win-amd64-3.9\yarl
copying yarl\_quoting_c.pyx -> build\lib.win-amd64-3.9\yarl
copying yarl\py.typed -> build\lib.win-amd64-3.9\yarl
running build_ext
building 'yarl._quoting_c' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for yarl
Building wheel for multidict (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\mt\appdata\local\programs\python\python39\python.exe' 'c:\users\mt\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\MT\AppData\Local\Temp\tmpzb98brnr'
cwd: C:\Users\MT\AppData\Local\Temp\pip-install-nztu4nu2\multidict
Complete output (40 lines):
**********************
* Accellerated build *
**********************
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\multidict
copying multidict\_abc.py -> build\lib.win-amd64-3.9\multidict
copying multidict\_compat.py -> build\lib.win-amd64-3.9\multidict
copying multidict\_multidict_base.py -> build\lib.win-amd64-3.9\multidict
copying multidict\_multidict_py.py -> build\lib.win-amd64-3.9\multidict
copying multidict\__init__.py -> build\lib.win-amd64-3.9\multidict
running egg_info
writing multidict.egg-info\PKG-INFO
writing dependency_links to multidict.egg-info\dependency_links.txt
writing top-level names to multidict.egg-info\top_level.txt
reading manifest file 'multidict.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files found matching 'multidict\_multidict.html'
warning: no previously-included files found matching 'multidict\*.so'
warning: no previously-included files found matching 'multidict\*.pyd'
warning: no previously-included files found matching 'multidict\*.pyd'
no previously-included directories found matching 'docs\_build'
writing manifest file 'multidict.egg-info\SOURCES.txt'
copying multidict\__init__.pyi -> build\lib.win-amd64-3.9\multidict
copying multidict\_multidict.c -> build\lib.win-amd64-3.9\multidict
copying multidict\py.typed -> build\lib.win-amd64-3.9\multidict
creating build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\defs.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\dict.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\istr.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\iter.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\pair_list.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\views.h -> build\lib.win-amd64-3.9\multidict\_multilib
running build_ext
building 'multidict._multidict' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for multidict
Failed to build yarl multidict
ERROR: Could not build wheels for yarl, multidict which use PEP 517 and cannot be installed directly```
I had a similar problem with a package with yarl, multidict dependencies. To fix it, I just upgraded my pip:
pip install --upgrade pip
pip install discord
UPDATE JAN 8, 2021: Discord.py v1.6 has been released, changelogs include a bump in the dependencies for building wheels
Old message below
If you want to stay on 3.9:
Install Devon's personal builds of aiohttp, multidict, yarl, and PyNaCl (https://github.com/Rapptz/discord.py/issues/5984#issuecomment-727684359), e.g.:
py -3.9 -m pip install --upgrade discord.py[voice] --extra-index-url https://gorialis.github.io/pip/
Install the Micosoft Visual C++ standalone compilers (https://wiki.python.org/moin/WindowsCompilers) and try to install discord.py in a Native Tools Command Prompt
Install from the latest development version of discord.py on the master branch (https://github.com/Rapptz/discord.py#installing), e.g.:
py -3.9 -m pip install --upgrade "discord.py[voice] # git+git://github.com/Rapptz/discord.py.git"
Install multidict and yarl from precompiled wheels on https://www.lfd.uci.edu/~gohlke/pythonlibs/ (note, PyNaCl for voice support is not supplied there)
Install the latest versions of discord.py's dependencies and install discord.py without dependencies, e.g.:
py -3.9 -m pip install --upgrade aiohttp pynacl
py -3.9 -m pip install --upgrade discord.py --no-dependencies
Use Python 3.8, for which prebuilt wheels are available for the dependency versions discord.py v1.5.1 uses
Wait for discord.py v1.6.0 to be released(RELEASED JAN 8 2021)
Up to date as of January 8, 2021
I also had the exact same issue today, since i downloaded node.js and it updated my python 8 to python 9 and i had to reinstall all of my moduels including dpy.
The solution is to follow what it says
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
https://visualstudio.microsoft.com/visual-cpp-build-tools/
Using latest versions of the libraries (instead of versions mentioned in repo) yarl, multidict, pandas for the apache superset setup on Mac M2 Apple Chip fixes this problem.
This question deals with discord.py errors caused by asyncio, but any advice on creating discord bots would be very welcome. I am more than willing to read documentation to fully understand responses, and will pursue provided articles.
Problem:
I am attempting to create a simple discord bot in python 3.9. I am new to python, and have been using pycharm to write my scripts. I found an error while attempting to run the script. Script provided here:
import discord
client = discord.Client()
#client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
#client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('$hello'):
await message.channel.send('Hello!')
client.run('my bot token')
Error provided here:
Traceback (most recent call last):
File "C:\Users\User\py_projects\discord\scrambot_main.py", line 2, in <module>
import discord
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\__init__.py", line 20, in <module>
from .client import Client, AppInfo, ChannelPermissions
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 38, in <module>
from .state import ConnectionState
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\state.py", line 36, in <module>
from . import utils, compat
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\compat.py", line 32
create_task = asyncio.async
^
SyntaxError: invalid syntax
Solutions I've Seen So Far:
I have seen a myriad of questions asking the same for python 3.7, and none for 3.9. This would either be because nobody else experiences the same error with python 3.9 in pycharm, or the solution is the same as in python 3.7.
I have seen many people recommending dropping to version 3.6 of python because async is a keyword in 3.7, which I want to avoid if possible. I'm fairly sure it still is a keyword in 3.9.
Some responses have said that pycharm creates virtual environments and would not have discord.py installed. This is not true in my case -- I have checked my project preferences and discord.py is in fact included and accessible by my script. More evidence is in the error message: the line causing problems is found in the discord.py directory, so the compiler must be able to access it. Right?
The problem may arise from the fact that i installed using pip install discord.py and then tried again with pip3 install discord.py. As far as I can tell, these worked as intended. There is an error if i try to use pip3 install discord or pip install discord, which I have provided. I do not know if the .py makes a difference, but if it does, i'm sure it would help to know that. The only other version of a solution i've seen is downloading the rewrite version of discord.py off github. I have not tried this yet because i want to make this version work if possible.
C:\Users\User>pip3 install discord
Collecting discord
Using cached discord-1.0.1-py3-none-any.whl (1.1 kB)
Collecting discord.py>=1.0.1
Using cached discord.py-1.5.1-py3-none-any.whl (701 kB)
Processing c:\users\user\appdata\local\pip\cache\wheels\b6\9c\bd\6b99bc6ec9dab11f3756d31fb8506d3ecf07aea58b6201f539\aiohttp-3.6.3-py3-none-any.whl
Collecting attrs>=17.3.0
Using cached attrs-20.2.0-py2.py3-none-any.whl (48 kB)
Requirement already satisfied: chardet<4.0,>=2.0 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from aiohttp<3.7.0,>=3.6.0->discord.py>=1.0.1->discord) (3.0.4)
Collecting yarl<1.6.0,>=1.0
Using cached yarl-1.5.1.tar.gz (173 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Collecting multidict<5.0,>=4.5
Using cached multidict-4.7.6.tar.gz (50 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: async-timeout<4.0,>=3.0 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from aiohttp<3.7.0,>=3.6.0->discord.py>=1.0.1->discord) (3.0.1)
Collecting idna>=2.0
Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Building wheels for collected packages: yarl, multidict
Building wheel for yarl (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\user\appdata\local\programs\python\python39\python.exe' 'c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\User\AppData\Local\Temp\tmpib94rz6b'
cwd: C:\Users\User\AppData\Local\Temp\pip-install-rrtk0pij\yarl
Complete output (35 lines):
**********************
* Accellerated build *
**********************
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\yarl
copying yarl\_quoting.py -> build\lib.win-amd64-3.9\yarl
copying yarl\_quoting_py.py -> build\lib.win-amd64-3.9\yarl
copying yarl\_url.py -> build\lib.win-amd64-3.9\yarl
copying yarl\__init__.py -> build\lib.win-amd64-3.9\yarl
running egg_info
writing yarl.egg-info\PKG-INFO
writing dependency_links to yarl.egg-info\dependency_links.txt
writing requirements to yarl.egg-info\requires.txt
writing top-level names to yarl.egg-info\top_level.txt
reading manifest file 'yarl.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.cache' found anywhere in distribution
warning: no previously-included files found matching 'yarl\*.html'
warning: no previously-included files found matching 'yarl\*.so'
warning: no previously-included files found matching 'yarl\*.pyd'
no previously-included directories found matching 'docs\_build'
writing manifest file 'yarl.egg-info\SOURCES.txt'
copying yarl\__init__.pyi -> build\lib.win-amd64-3.9\yarl
copying yarl\_quoting_c.c -> build\lib.win-amd64-3.9\yarl
copying yarl\_quoting_c.pyi -> build\lib.win-amd64-3.9\yarl
copying yarl\_quoting_c.pyx -> build\lib.win-amd64-3.9\yarl
copying yarl\py.typed -> build\lib.win-amd64-3.9\yarl
running build_ext
building 'yarl._quoting_c' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for yarl
Building wheel for multidict (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\user\appdata\local\programs\python\python39\python.exe' 'c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\User\AppData\Local\Temp\tmp_yeznrct'
cwd: C:\Users\User\AppData\Local\Temp\pip-install-rrtk0pij\multidict
Complete output (40 lines):
**********************
* Accellerated build *
**********************
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\multidict
copying multidict\_abc.py -> build\lib.win-amd64-3.9\multidict
copying multidict\_compat.py -> build\lib.win-amd64-3.9\multidict
copying multidict\_multidict_base.py -> build\lib.win-amd64-3.9\multidict
copying multidict\_multidict_py.py -> build\lib.win-amd64-3.9\multidict
copying multidict\__init__.py -> build\lib.win-amd64-3.9\multidict
running egg_info
writing multidict.egg-info\PKG-INFO
writing dependency_links to multidict.egg-info\dependency_links.txt
writing top-level names to multidict.egg-info\top_level.txt
reading manifest file 'multidict.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files found matching 'multidict\_multidict.html'
warning: no previously-included files found matching 'multidict\*.so'
warning: no previously-included files found matching 'multidict\*.pyd'
warning: no previously-included files found matching 'multidict\*.pyd'
no previously-included directories found matching 'docs\_build'
writing manifest file 'multidict.egg-info\SOURCES.txt'
copying multidict\__init__.pyi -> build\lib.win-amd64-3.9\multidict
copying multidict\_multidict.c -> build\lib.win-amd64-3.9\multidict
copying multidict\py.typed -> build\lib.win-amd64-3.9\multidict
creating build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\defs.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\dict.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\istr.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\iter.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\pair_list.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\views.h -> build\lib.win-amd64-3.9\multidict\_multilib
running build_ext
building 'multidict._multidict' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for multidict
Failed to build yarl multidict
ERROR: Could not build wheels for yarl, multidict which use PEP 517 and cannot be installed directly
Questions:
Has anyone had success with discord bots in python 3.9?
Is something wrong with my script?
Is async a keyword in python 3.9? If so, how can i modify my program to solve this problem?
How can I fix this issue without downgrading to python 3.6? Is that the only way?
Why does pip install discord not work? What are wheels? I do not want to install C++ build tools.
Would it be easier to program a bot in C++ or JS? I don't know any JS but i am familiar with C++.
Any help with this issue would be massively appreciated. Also, as this is my first stack overflow post, please feel free to let me know if i could have done anything better in asking this question. if there's anything else i can provide to help you wonderful developers who are willing to spend their time solving noob problems like this one, please let me know.
Also, if willing and able, please provide some tips for writing discord bots. This is intended to be a small Admin bot created to test and develop my python skills. Interaction with people is the focus, not automation of any kind, although I do want to try out as many ideas as possible.
Edit:
Included PyCharm python interpreter settings.
Also had an issue with opening a new venv project and installing discord.py to it. Same wheels error as above, provided errors and other relevant windows in the image below. also not sure where to put my script file or how to make the run configuration.
the issue is with your discord.Client() you should never use that instead use
from discord.ext import commands
client = commands.Bot(prefix="ur prefix")
And you have written command in wrong way
#client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('$hello'):
await message.channel.send('Hello!')
correct way :
#client.command()
async def hello(ctx):
await ctx.send("Hello!")
trying to download discord.py using pip install, gave me the error message in the title.
I installed using cmd and the commands py -m pip install -U discord, the cmd was also run in admin.
tried using pip, pip3, and pip3.9, all of which didnt work.
I tried uninstalling/reinstalling/upgrading (in that order) the said libraries:
pip
yarl
multidict
wheel
setuptools
versions of python that I tried (in all versions are downloaded with default settings with nothing changed):
python-3.9.0-amd64.exe
python-3.9.0.exe
I tried researching about wheels and tried installing with --no-binary :all: as well, but it gave the same error message below.
in all the iterations of what I have tried, it churned out the exact same error message without any deviation
ples help :<
Using cached discord-1.0.1-py3-none-any.whl (1.1 kB)
Collecting discord.py>=1.0.1
Using cached discord.py-1.5.1-py3-none-any.whl (701 kB)
Processing c:\users\mt\appdata\local\pip\cache\wheels\b6\9c\bd\6b99bc6ec9dab11f3756d31fb8506d3ecf07aea58b6201f539\aiohttp-3.6.3-py3-none-any.whl
Collecting attrs>=17.3.0
Using cached attrs-20.2.0-py2.py3-none-any.whl (48 kB)
Collecting chardet<4.0,>=2.0
Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting async-timeout<4.0,>=3.0
Using cached async_timeout-3.0.1-py3-none-any.whl (8.2 kB)
Collecting yarl<1.6.0,>=1.0
Using cached yarl-1.5.1.tar.gz (173 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Collecting multidict<5.0,>=4.5
Using cached multidict-4.7.6.tar.gz (50 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Collecting idna>=2.0
Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Building wheels for collected packages: yarl, multidict
Building wheel for yarl (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\mt\appdata\local\programs\python\python39\python.exe' 'c:\users\mt\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\MT\AppData\Local\Temp\tmptlhkh7zi'
cwd: C:\Users\MT\AppData\Local\Temp\pip-install-nztu4nu2\yarl
Complete output (35 lines):
**********************
* Accellerated build *
**********************
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\yarl
copying yarl\_quoting.py -> build\lib.win-amd64-3.9\yarl
copying yarl\_quoting_py.py -> build\lib.win-amd64-3.9\yarl
copying yarl\_url.py -> build\lib.win-amd64-3.9\yarl
copying yarl\__init__.py -> build\lib.win-amd64-3.9\yarl
running egg_info
writing yarl.egg-info\PKG-INFO
writing dependency_links to yarl.egg-info\dependency_links.txt
writing requirements to yarl.egg-info\requires.txt
writing top-level names to yarl.egg-info\top_level.txt
reading manifest file 'yarl.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.cache' found anywhere in distribution
warning: no previously-included files found matching 'yarl\*.html'
warning: no previously-included files found matching 'yarl\*.so'
warning: no previously-included files found matching 'yarl\*.pyd'
no previously-included directories found matching 'docs\_build'
writing manifest file 'yarl.egg-info\SOURCES.txt'
copying yarl\__init__.pyi -> build\lib.win-amd64-3.9\yarl
copying yarl\_quoting_c.c -> build\lib.win-amd64-3.9\yarl
copying yarl\_quoting_c.pyi -> build\lib.win-amd64-3.9\yarl
copying yarl\_quoting_c.pyx -> build\lib.win-amd64-3.9\yarl
copying yarl\py.typed -> build\lib.win-amd64-3.9\yarl
running build_ext
building 'yarl._quoting_c' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for yarl
Building wheel for multidict (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\mt\appdata\local\programs\python\python39\python.exe' 'c:\users\mt\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\MT\AppData\Local\Temp\tmpzb98brnr'
cwd: C:\Users\MT\AppData\Local\Temp\pip-install-nztu4nu2\multidict
Complete output (40 lines):
**********************
* Accellerated build *
**********************
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\multidict
copying multidict\_abc.py -> build\lib.win-amd64-3.9\multidict
copying multidict\_compat.py -> build\lib.win-amd64-3.9\multidict
copying multidict\_multidict_base.py -> build\lib.win-amd64-3.9\multidict
copying multidict\_multidict_py.py -> build\lib.win-amd64-3.9\multidict
copying multidict\__init__.py -> build\lib.win-amd64-3.9\multidict
running egg_info
writing multidict.egg-info\PKG-INFO
writing dependency_links to multidict.egg-info\dependency_links.txt
writing top-level names to multidict.egg-info\top_level.txt
reading manifest file 'multidict.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files found matching 'multidict\_multidict.html'
warning: no previously-included files found matching 'multidict\*.so'
warning: no previously-included files found matching 'multidict\*.pyd'
warning: no previously-included files found matching 'multidict\*.pyd'
no previously-included directories found matching 'docs\_build'
writing manifest file 'multidict.egg-info\SOURCES.txt'
copying multidict\__init__.pyi -> build\lib.win-amd64-3.9\multidict
copying multidict\_multidict.c -> build\lib.win-amd64-3.9\multidict
copying multidict\py.typed -> build\lib.win-amd64-3.9\multidict
creating build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\defs.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\dict.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\istr.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\iter.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\pair_list.h -> build\lib.win-amd64-3.9\multidict\_multilib
copying multidict\_multilib\views.h -> build\lib.win-amd64-3.9\multidict\_multilib
running build_ext
building 'multidict._multidict' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for multidict
Failed to build yarl multidict
ERROR: Could not build wheels for yarl, multidict which use PEP 517 and cannot be installed directly```
I had a similar problem with a package with yarl, multidict dependencies. To fix it, I just upgraded my pip:
pip install --upgrade pip
pip install discord
UPDATE JAN 8, 2021: Discord.py v1.6 has been released, changelogs include a bump in the dependencies for building wheels
Old message below
If you want to stay on 3.9:
Install Devon's personal builds of aiohttp, multidict, yarl, and PyNaCl (https://github.com/Rapptz/discord.py/issues/5984#issuecomment-727684359), e.g.:
py -3.9 -m pip install --upgrade discord.py[voice] --extra-index-url https://gorialis.github.io/pip/
Install the Micosoft Visual C++ standalone compilers (https://wiki.python.org/moin/WindowsCompilers) and try to install discord.py in a Native Tools Command Prompt
Install from the latest development version of discord.py on the master branch (https://github.com/Rapptz/discord.py#installing), e.g.:
py -3.9 -m pip install --upgrade "discord.py[voice] # git+git://github.com/Rapptz/discord.py.git"
Install multidict and yarl from precompiled wheels on https://www.lfd.uci.edu/~gohlke/pythonlibs/ (note, PyNaCl for voice support is not supplied there)
Install the latest versions of discord.py's dependencies and install discord.py without dependencies, e.g.:
py -3.9 -m pip install --upgrade aiohttp pynacl
py -3.9 -m pip install --upgrade discord.py --no-dependencies
Use Python 3.8, for which prebuilt wheels are available for the dependency versions discord.py v1.5.1 uses
Wait for discord.py v1.6.0 to be released(RELEASED JAN 8 2021)
Up to date as of January 8, 2021
I also had the exact same issue today, since i downloaded node.js and it updated my python 8 to python 9 and i had to reinstall all of my moduels including dpy.
The solution is to follow what it says
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
https://visualstudio.microsoft.com/visual-cpp-build-tools/
Using latest versions of the libraries (instead of versions mentioned in repo) yarl, multidict, pandas for the apache superset setup on Mac M2 Apple Chip fixes this problem.
All sorta new to using Microsoft Azure and needed help deploying a Django App to it. When I push the code from my local repo to Azure it gives me this log.
I noticed it says :
The headers or library files could not be found for zlib, a required
dependency when compiling Pillow from source. Please see the install
instructions at
https://pillow.readthedocs.io/en/latest/installation.html
I did more reading and learnt that Azure cannot install PIL or Pillow from the environment and hence needs to be installed on my system and then uploaded to Azure. I included a file called ".skipPythonDeployment" so that it doesn't erase the environment set on my local system, but then the deployment would fail again.
The important part of the Log generated while Pushing the code to Azure is attached below.
Detected requirements.txt. You can skip Python specific steps with
a .skipPythonDeployment file. Detecting Python runtime from site
configuration Detected python-2.7 Deleting incompatible virtual
environment.
............................................................ Creating
python-2.7 virtual environment.
Downloading/unpacking pillow (from -r requirements.txt (line 4))
.... Running setup.py
(path:D:\home\site\wwwroot\env\build\pillow\setup.py) egg_info for
package pillow
Single threaded build for windows
warning: no files found matching '.sh'
no previously-included directories found matching 'docs_static'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.landscape.yaml'
warning: no previously-included files found matching '.travis'
warning: no previously-included files found matching '.travis*'
warning: no previously-included files found matching 'appveyor.yml'
warning: no previously-included files found matching 'build_children.sh'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files matching '.git' found anywhere in distribution
warning: no previously-included files matching '.pyc' found anywhere in distribution
warning: no previously-included files matching '.so' found anywhere in distribution
warning: no files found matching '.sh'
no previously-included directories found matching 'docs_static'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.landscape.yaml'
warning: no previously-included files found matching '.travis'
warning: no previously-included files found matching '.travis*'
warning: no previously-included files found matching 'appveyor.yml'
warning: no previously-included files found matching 'build_children.sh'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files matching '.git' found anywhere in distribution
warning: no previously-included files matching '.pyc' found anywhere in distribution
warning: no previously-included files matching '.so' found anywhere in distribution Downloading/unpacking Werkzeug (from -r
requirements.txt (line 5)) Downloading/unpacking flask-cors (from -r
requirements.txt (line 6)) Downloading
Flask_Cors-3.0.2-py2.py3-none-any.whl Downloading/unpacking
Flask>=0.8 (from flask-restful->-r requirements.txt (line 1))
Downloading/unpacking pytz (from flask-restful->-r requirements.txt
(line 1)) Downloading/unpacking six>=1.3.0 (from flask-restful->-r
requirements.txt (line 1)) Downloading
six-1.10.0-py2.py3-none-any.whl Downloading/unpacking aniso8601>=0.82
(from flask-restful->-r requirements.txt (line 1)) Running setup.py
(path:D:\home\site\wwwroot\env\build\aniso8601\setup.py) egg_info for
package aniso8601
Downloading/unpacking olefile (from pillow->-r requirements.txt (line 4)) Running setup.py
(path:D:\home\site\wwwroot\env\build\olefile\setup.py) egg_info for
package olefile
Downloading/unpacking itsdangerous>=0.21 (from Flask>=0.8->flask-restful->-r requirements.txt (line 1)) Running
setup.py (path:D:\home\site\wwwroot\env\build\itsdangerous\setup.py)
egg_info for package itsdangerous
warning: no previously-included files matching '' found under directory 'docs_build' Downloading/unpacking Jinja2>=2.4 (from
Flask>=0.8->flask-restful->-r requirements.txt (line 1))
Downloading/unpacking click>=2.0 (from Flask>=0.8->flask-restful->-r
requirements.txt (line 1)) Downloading/unpacking python-dateutil
(from aniso8601>=0.82->flask-restful->-r requirements.txt (line 1))
Downloading/unpacking MarkupSafe>=0.23 (from
Jinja2>=2.4->Flask>=0.8->flask-restful->-r requirements.txt (line 1))
Downloading MarkupSafe-1.0.tar.gz Running setup.py
(path:D:\home\site\wwwroot\env\build\MarkupSafe\setup.py) egg_info for
package MarkupSafe
Installing collected packages: flask-restful, numpy, pydicom, pillow, Werkzeug, flask-cors, Flask, pytz, six, aniso8601, olefile,
itsdangerous, Jinja2, click, python-dateutil, MarkupSafe
.................. : .................. Running setup.py install
for pydicom .
.. Running setup.py install for pillow
Single threaded build for windows
warning: no files found matching '.sh'
no previously-included directories found matching 'docs_static'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.landscape.yaml'
warning: no previously-included files found matching '.travis'
warning: no previously-included files found matching '.travis*'
warning: no previously-included files found matching 'appveyor.yml'
warning: no previously-included files found matching 'build_children.sh'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '.pyc' found anywhere in distribution
warning: no previously-included files matching '.so' found anywhere in distribution
The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\home\site\wwwroot\env\build\pillow\setup.py", line 756, in <module>
raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:
The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
Complete output from command D:\home\site\wwwroot\env\Scripts\python.exe -c "import setuptools,
tokenize;file='D:\home\site\wwwroot\env\build\pillow\setup.py';exec(compile(getattr(tokenize,
'open', open)(file).read().replace('\r\n', '\n'), file,
'exec'))" install --record
d:\local\temp\pip-nu1mtm-record\install-record.txt
--single-version-externally-managed --compile --install-headers D:\home\site\wwwroot\env\include\site\python2.7:
Single threaded build for windows running install running build running build_py creating build creating
build\lib.win32-2.7 creating build\lib.win32-2.7\PIL copying
PIL\BdfFontFile.py -> build\lib.win32-2.7\PIL copying
PIL\BmpImagePlugin.py -> build\lib.win32-2.7\PIL copying
PIL\BufrStubImagePlugin.py -> build\lib.win32-2.7\PIL copying
PIL\ContainerIO.py -> build\lib.win32-2.7\PIL copying
PIL\CurImagePlugin.py -> build\lib.win32-2.7\PIL copying
PIL\DcxImagePlugin.py -> build\lib.win32-2.7\PIL copying
PIL\DdsImagePlugin.py -> build\lib.win32-2.7\PIL copying
PIL\EpsImagePlugin.py -> build\lib.win32-2.7\PIL copying
PIL\ExifTags.py -> build\lib.win32-2.7\PIL copying PIL\features.py
-> build\lib.win32-2.7\PIL copying PIL\FitsStubImagePlugin.py -> build\lib.win32-2.7\PIL copying PIL\FliImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\FontFile.py ->
build\lib.win32-2.7\PIL copying PIL\FpxImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\FtexImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\GbrImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\GdImageFile.py ->
build\lib.win32-2.7\PIL copying PIL\GifImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\GimpGradientFile.py ->
build\lib.win32-2.7\PIL copying PIL\GimpPaletteFile.py ->
build\lib.win32-2.7\PIL copying PIL\GribStubImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\Hdf5StubImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\IcnsImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\IcoImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\Image.py ->
build\lib.win32-2.7\PIL copying PIL\ImageChops.py ->
build\lib.win32-2.7\PIL copying PIL\ImageCms.py ->
build\lib.win32-2.7\PIL copying PIL\ImageColor.py ->
build\lib.win32-2.7\PIL copying PIL\ImageDraw.py ->
build\lib.win32-2.7\PIL copying PIL\ImageDraw2.py ->
build\lib.win32-2.7\PIL copying PIL\ImageEnhance.py ->
build\lib.win32-2.7\PIL copying PIL\ImageFile.py ->
build\lib.win32-2.7\PIL copying PIL\ImageFilter.py ->
build\lib.win32-2.7\PIL copying PIL\ImageFont.py ->
build\lib.win32-2.7\PIL copying PIL\ImageGrab.py ->
build\lib.win32-2.7\PIL copying PIL\ImageMath.py ->
build\lib.win32-2.7\PIL copying PIL\ImageMode.py ->
build\lib.win32-2.7\PIL copying PIL\ImageMorph.py ->
build\lib.win32-2.7\PIL copying PIL\ImageOps.py ->
build\lib.win32-2.7\PIL copying PIL\ImagePalette.py ->
build\lib.win32-2.7\PIL copying PIL\ImagePath.py ->
build\lib.win32-2.7\PIL copying PIL\ImageQt.py ->
build\lib.win32-2.7\PIL copying PIL\ImageSequence.py ->
build\lib.win32-2.7\PIL copying PIL\ImageShow.py ->
build\lib.win32-2.7\PIL copying PIL\ImageStat.py ->
build\lib.win32-2.7\PIL copying PIL\ImageTk.py ->
build\lib.win32-2.7\PIL copying PIL\ImageTransform.py ->
build\lib.win32-2.7\PIL copying PIL\ImageWin.py ->
build\lib.win32-2.7\PIL copying PIL\ImImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\ImtImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\IptcImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\Jpeg2KImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\JpegImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\JpegPresets.py ->
build\lib.win32-2.7\PIL copying PIL\McIdasImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\MicImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\MpegImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\MpoImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\MspImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\OleFileIO.py ->
build\lib.win32-2.7\PIL copying PIL\PaletteFile.py ->
build\lib.win32-2.7\PIL copying PIL\PalmImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\PcdImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\PcfFontFile.py ->
build\lib.win32-2.7\PIL copying PIL\PcxImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\PdfImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\PixarImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\PngImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\PpmImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\PsdImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\PSDraw.py ->
build\lib.win32-2.7\PIL copying PIL\PyAccess.py ->
build\lib.win32-2.7\PIL copying PIL\SgiImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\SpiderImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\SunImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\TarIO.py ->
build\lib.win32-2.7\PIL copying PIL\TgaImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\TiffImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\TiffTags.py ->
build\lib.win32-2.7\PIL copying PIL\WalImageFile.py ->
build\lib.win32-2.7\PIL copying PIL\WebPImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\WmfImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\XbmImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\XpmImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL\XVThumbImagePlugin.py ->
build\lib.win32-2.7\PIL copying PIL_binary.py ->
build\lib.win32-2.7\PIL copying PIL_tkinter_finder.py ->
build\lib.win32-2.7\PIL copying PIL_util.py ->
build\lib.win32-2.7\PIL copying PIL__init__.py ->
build\lib.win32-2.7\PIL running egg_info writing requirements to
Pillow.egg-info\requires.txt writing Pillow.egg-info\PKG-INFO
writing top-level names to Pillow.egg-info\top_level.txt writing
dependency_links to Pillow.egg-info\dependency_links.txt warning:
manifest_maker: standard file '-c' not found
reading manifest file 'Pillow.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching
'.sh' no previously-included directories found matching
'docs_static' warning: no previously-included files found matching
'.coveragerc' warning: no previously-included files found matching
'.editorconfig' warning: no previously-included files found
matching '.landscape.yaml' warning: no previously-included files
found matching '.travis' warning: no previously-included files
found matching '.travis*' warning: no previously-included files
found matching 'appveyor.yml' warning: no previously-included files
found matching 'build_children.sh' warning: no previously-included
files found matching 'tox.ini' warning: no previously-included
files matching '.git' found anywhere in distribution warning: no
previously-included files matching '.pyc' found anywhere in
distribution warning: no previously-included files matching '.so'
found anywhere in distribution writing manifest file
'Pillow.egg-info\SOURCES.txt' running build_ext
The headers or library files could not be found for zlib, a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\home\site\wwwroot\env\build\pillow\setup.py", line 756, in <module>
raise RequiredDependencyException(msg) __main__.RequiredDependencyException:
The headers or library files could not be found for zlib, a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
---------------------------------------- Cleaning up... .................................................... Command
D:\home\site\wwwroot\env\Scripts\python.exe -c "import setuptools,
tokenize;file='D:\home\site\wwwroot\env\build\pillow\setup.py';exec(compile(getattr(tokenize,
'open', open)(file).read().replace('\r\n', '\n'), file,
'exec'))" install --record
d:\local\temp\pip-nu1mtm-record\install-record.txt
--single-version-externally-managed --compile --install-headers D:\home\site\wwwroot\env\include\site\python2.7 failed with error code
1 in D:\home\site\wwwroot\env\build\pillow Storing debug log for
failure in D:\home\pip\pip.log An error has occurred during web site
deployment. Error - Changes committed to remote repository but
deployment to website failed.
Thank you
It seems that you were using Azure Web Apps/App Services for deploying your Django App which contains the Pillow package, and the Pillow package seems that you declared in the requirements.txt like Pillow>=2.0.0.
However, unfortunately, there are two issues for using the Pillow package on Azure App Services.
Pillow includes C code which need to be compiled when deploying your app into Azure. The solution is that you need to build a wheel file of Pillow to add it to your project and declare the wheel file in the requirements.txt, please refer to the section Troubleshooting - Package Installation of Azure offical tutorial for Django to know it.
Pillow as an image library for Python required GDI API & resources. On Azure App Services, any GDI calls are restricted and blocked, please see here to know.
So the only way for deploying your Django App is using Azure VM.
Your pip is too old to download the whl (known issues with default version of Python). Please update your Python installation or update pip directly:
https://blogs.msdn.microsoft.com/pythonengineering/2016/08/04/upgrading-python-on-azure-app-service/