[WinError 193] %1 is not a valid Win32 application #1939

Closed
opened 2018-07-16 05:48:10 +02:00 by ghost · 2 comments
ghost commented 2018-07-16 05:48:10 +02:00 (Migrated from github.com)

The requirements installer throws the above error on PyNaCl
I have tried re-cloning the repo, reinstalling python, and reinstalling visual studio
Running on Windows 10 Home 64-bit
Full launcher output:

Red Discord Bot - Launcher


Main requirements:

1. Install basic + audio requirements (recommended)
2. Install basic requirements

ffmpeg (required for audio):
3. Install ffmpeg 32bit
4. Install ffmpeg 64bit (recommended on Windows 64bit)

0. Go back
> 1
Collecting pip (from -r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl
Collecting discord.py[voice] from git+git://github.com/Rapptz/discord.py.git#egg=discord.py[voice] (from -r requirements.txt (line 2))
  Cloning git://github.com/Rapptz/discord.py.git to c:\users\alask\appdata\local\temp\pip-install-5j_o21yf\discord.py
Collecting youtube_dl (from -r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/5f/d5/a279c682e5614ca21a77a40b83c9b72ce200426eeda7c0e7978b3537bb3e/youtube_dl-2018.7.10-py2.py3-none-any.whl
Collecting imgurpython (from -r requirements.txt (line 4))
  Using cached https://files.pythonhosted.org/packages/d4/76/514defcb05e6d58ded427f57d736ce6dfe879e0188392385a986e8ef3b7b/imgurpython-1.1.7.tar.gz
Collecting aiohttp<1.1.0,>=1.0.0 (from discord.py[voice]->-r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/09/5a/7b81ea8729d41f44c6fe6a116e466c8fb884950a0061aa3768dbd6bee2f8/aiohttp-1.0.5.tar.gz
Collecting websockets<4.0,>=3.1 (from discord.py[voice]->-r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/4a/e8/acf36f117deeb18c0b6679624fa11b57b0876044f0ce3f34024c3a7b2d95/websockets-3.4.tar.gz
Collecting PyNaCl==1.0.1 (from discord.py[voice]->-r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/dd/99/bc86d40c88c1e1c6c9338d5afa91e3126d1ae28ad1bdfac79ab5b01803df/PyNaCl-1.0.1.tar.gz
Collecting requests (from imgurpython->-r requirements.txt (line 4))
  Using cached https://files.pythonhosted.org/packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl
Collecting chardet (from aiohttp<1.1.0,>=1.0.0->discord.py[voice]->-r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting multidict>=2.0 (from aiohttp<1.1.0,>=1.0.0->discord.py[voice]->-r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/9d/b9/3cf1b908d7af6530209a7a16d71ab2734a736c3cdf0657e3a06d0209811e/multidict-4.3.1.tar.gz
Collecting async_timeout (from aiohttp<1.1.0,>=1.0.0->discord.py[voice]->-r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/96/0f/e6357458c87fb4ed8f3df215773f3caad40968f10e05552cbd8bd28415e4/async_timeout-3.0.0-py3-none-any.whl
Collecting six (from PyNaCl==1.0.1->discord.py[voice]->-r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting cffi>=1.1.0 (from PyNaCl==1.0.1->discord.py[voice]->-r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/2d/9e/9d84a78d4ea3d0fa94f6d0e4bcd88406709312949f48f3853f26f8f52ebe/cffi-1.11.5-cp37-cp37m-win32.whl
Collecting urllib3<1.24,>=1.21.1 (from requests->imgurpython->-r requirements.txt (line 4))
  Using cached https://files.pythonhosted.org/packages/bd/c9/6fdd990019071a4a32a5e7cb78a1d92c53851ef4f56f62a3486e6a7d8ffb/urllib3-1.23-py2.py3-none-any.whl
Collecting idna<2.8,>=2.5 (from requests->imgurpython->-r requirements.txt (line 4))
  Using cached https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests->imgurpython->-r requirements.txt (line 4))
  Using cached https://files.pythonhosted.org/packages/7c/e6/92ad559b7192d846975fc916b65f667c7b8c3a32bea7372340bfe9a15fa5/certifi-2018.4.16-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.1.0->PyNaCl==1.0.1->discord.py[voice]->-r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/8c/2d/aad7f16146f4197a11f8e91fb81df177adcc2073d36a17b1491fd09df6ed/pycparser-2.18.tar.gz
Installing collected packages: pip, chardet, multidict, async-timeout, aiohttp, websockets, six, pycparser, cffi, PyNaCl, discord.py, youtube-dl, urllib3, idna, certifi, requests, imgurpython
  Running setup.py install for multidict ... done
  Running setup.py install for aiohttp ... done
  Running setup.py install for websockets ... done
  Running setup.py install for pycparser ... done
  Running setup.py install for PyNaCl ... error
    Complete output from command C:\Users\alask\AppData\Local\Programs\Python\Python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\alask\\AppData\\Local\\Temp\\pip-install-5j_o21yf\\PyNaCl\\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\alask\AppData\Local\Temp\pip-record-c7xobe4i\install-record.txt --single-version-externally-managed --compile --home=C:\Users\alask\AppData\Local\Temp\pip-target-d9d4aa56:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.7
    creating build\lib.win32-3.7\nacl
    copying src\nacl\encoding.py -> build\lib.win32-3.7\nacl
    copying src\nacl\exceptions.py -> build\lib.win32-3.7\nacl
    copying src\nacl\hash.py -> build\lib.win32-3.7\nacl
    copying src\nacl\public.py -> build\lib.win32-3.7\nacl
    copying src\nacl\secret.py -> build\lib.win32-3.7\nacl
    copying src\nacl\signing.py -> build\lib.win32-3.7\nacl
    copying src\nacl\utils.py -> build\lib.win32-3.7\nacl
    copying src\nacl\__init__.py -> build\lib.win32-3.7\nacl
    creating build\lib.win32-3.7\nacl\bindings
    copying src\nacl\bindings\crypto_box.py -> build\lib.win32-3.7\nacl\bindings
    copying src\nacl\bindings\crypto_hash.py -> build\lib.win32-3.7\nacl\bindings
    copying src\nacl\bindings\crypto_scalarmult.py -> build\lib.win32-3.7\nacl\bindings
    copying src\nacl\bindings\crypto_secretbox.py -> build\lib.win32-3.7\nacl\bindings
    copying src\nacl\bindings\crypto_sign.py -> build\lib.win32-3.7\nacl\bindings
    copying src\nacl\bindings\randombytes.py -> build\lib.win32-3.7\nacl\bindings
    copying src\nacl\bindings\sodium_core.py -> build\lib.win32-3.7\nacl\bindings
    copying src\nacl\bindings\__init__.py -> build\lib.win32-3.7\nacl\bindings
    running build_clib
    error: [WinError 193] %1 is not a valid Win32 application

   
Command "C:\Users\alask\AppData\Local\Programs\Python\Python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\alask\\AppData\\Local\\Temp\\pip-install-5j_o21yf\\PyNaCl\\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\alask\AppData\Local\Temp\pip-record-c7xobe4i\install-record.txt --single-version-externally-managed --compile --home=C:\Users\alask\AppData\Local\Temp\pip-target-d9d4aa56" failed with error code 1 in C:\Users\alask\AppData\Local\Temp\pip-install-5j_o21yf\PyNaCl\

An error occurred and the requirements setup might not be completed. Consult the docs.

Press enter to continue.
<!-- Please be sure to use the correct template, if your report doesn't have the correct template please open an issue describing your issue in detail For support regarding the bot itself please visit the discord server over at https://discord.gg/red --> The requirements installer throws the above error on PyNaCl I have tried re-cloning the repo, reinstalling python, and reinstalling visual studio Running on Windows 10 Home 64-bit Full launcher output: ``` Red Discord Bot - Launcher Main requirements: 1. Install basic + audio requirements (recommended) 2. Install basic requirements ffmpeg (required for audio): 3. Install ffmpeg 32bit 4. Install ffmpeg 64bit (recommended on Windows 64bit) 0. Go back > 1 Collecting pip (from -r requirements.txt (line 1)) Using cached https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl Collecting discord.py[voice] from git+git://github.com/Rapptz/discord.py.git#egg=discord.py[voice] (from -r requirements.txt (line 2)) Cloning git://github.com/Rapptz/discord.py.git to c:\users\alask\appdata\local\temp\pip-install-5j_o21yf\discord.py Collecting youtube_dl (from -r requirements.txt (line 3)) Using cached https://files.pythonhosted.org/packages/5f/d5/a279c682e5614ca21a77a40b83c9b72ce200426eeda7c0e7978b3537bb3e/youtube_dl-2018.7.10-py2.py3-none-any.whl Collecting imgurpython (from -r requirements.txt (line 4)) Using cached https://files.pythonhosted.org/packages/d4/76/514defcb05e6d58ded427f57d736ce6dfe879e0188392385a986e8ef3b7b/imgurpython-1.1.7.tar.gz Collecting aiohttp<1.1.0,>=1.0.0 (from discord.py[voice]->-r requirements.txt (line 2)) Using cached https://files.pythonhosted.org/packages/09/5a/7b81ea8729d41f44c6fe6a116e466c8fb884950a0061aa3768dbd6bee2f8/aiohttp-1.0.5.tar.gz Collecting websockets<4.0,>=3.1 (from discord.py[voice]->-r requirements.txt (line 2)) Using cached https://files.pythonhosted.org/packages/4a/e8/acf36f117deeb18c0b6679624fa11b57b0876044f0ce3f34024c3a7b2d95/websockets-3.4.tar.gz Collecting PyNaCl==1.0.1 (from discord.py[voice]->-r requirements.txt (line 2)) Using cached https://files.pythonhosted.org/packages/dd/99/bc86d40c88c1e1c6c9338d5afa91e3126d1ae28ad1bdfac79ab5b01803df/PyNaCl-1.0.1.tar.gz Collecting requests (from imgurpython->-r requirements.txt (line 4)) Using cached https://files.pythonhosted.org/packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl Collecting chardet (from aiohttp<1.1.0,>=1.0.0->discord.py[voice]->-r requirements.txt (line 2)) Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl Collecting multidict>=2.0 (from aiohttp<1.1.0,>=1.0.0->discord.py[voice]->-r requirements.txt (line 2)) Using cached https://files.pythonhosted.org/packages/9d/b9/3cf1b908d7af6530209a7a16d71ab2734a736c3cdf0657e3a06d0209811e/multidict-4.3.1.tar.gz Collecting async_timeout (from aiohttp<1.1.0,>=1.0.0->discord.py[voice]->-r requirements.txt (line 2)) Using cached https://files.pythonhosted.org/packages/96/0f/e6357458c87fb4ed8f3df215773f3caad40968f10e05552cbd8bd28415e4/async_timeout-3.0.0-py3-none-any.whl Collecting six (from PyNaCl==1.0.1->discord.py[voice]->-r requirements.txt (line 2)) Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl Collecting cffi>=1.1.0 (from PyNaCl==1.0.1->discord.py[voice]->-r requirements.txt (line 2)) Using cached https://files.pythonhosted.org/packages/2d/9e/9d84a78d4ea3d0fa94f6d0e4bcd88406709312949f48f3853f26f8f52ebe/cffi-1.11.5-cp37-cp37m-win32.whl Collecting urllib3<1.24,>=1.21.1 (from requests->imgurpython->-r requirements.txt (line 4)) Using cached https://files.pythonhosted.org/packages/bd/c9/6fdd990019071a4a32a5e7cb78a1d92c53851ef4f56f62a3486e6a7d8ffb/urllib3-1.23-py2.py3-none-any.whl Collecting idna<2.8,>=2.5 (from requests->imgurpython->-r requirements.txt (line 4)) Using cached https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl Collecting certifi>=2017.4.17 (from requests->imgurpython->-r requirements.txt (line 4)) Using cached https://files.pythonhosted.org/packages/7c/e6/92ad559b7192d846975fc916b65f667c7b8c3a32bea7372340bfe9a15fa5/certifi-2018.4.16-py2.py3-none-any.whl Collecting pycparser (from cffi>=1.1.0->PyNaCl==1.0.1->discord.py[voice]->-r requirements.txt (line 2)) Using cached https://files.pythonhosted.org/packages/8c/2d/aad7f16146f4197a11f8e91fb81df177adcc2073d36a17b1491fd09df6ed/pycparser-2.18.tar.gz Installing collected packages: pip, chardet, multidict, async-timeout, aiohttp, websockets, six, pycparser, cffi, PyNaCl, discord.py, youtube-dl, urllib3, idna, certifi, requests, imgurpython Running setup.py install for multidict ... done Running setup.py install for aiohttp ... done Running setup.py install for websockets ... done Running setup.py install for pycparser ... done Running setup.py install for PyNaCl ... error Complete output from command C:\Users\alask\AppData\Local\Programs\Python\Python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\alask\\AppData\\Local\\Temp\\pip-install-5j_o21yf\\PyNaCl\\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\alask\AppData\Local\Temp\pip-record-c7xobe4i\install-record.txt --single-version-externally-managed --compile --home=C:\Users\alask\AppData\Local\Temp\pip-target-d9d4aa56: running install running build running build_py creating build creating build\lib.win32-3.7 creating build\lib.win32-3.7\nacl copying src\nacl\encoding.py -> build\lib.win32-3.7\nacl copying src\nacl\exceptions.py -> build\lib.win32-3.7\nacl copying src\nacl\hash.py -> build\lib.win32-3.7\nacl copying src\nacl\public.py -> build\lib.win32-3.7\nacl copying src\nacl\secret.py -> build\lib.win32-3.7\nacl copying src\nacl\signing.py -> build\lib.win32-3.7\nacl copying src\nacl\utils.py -> build\lib.win32-3.7\nacl copying src\nacl\__init__.py -> build\lib.win32-3.7\nacl creating build\lib.win32-3.7\nacl\bindings copying src\nacl\bindings\crypto_box.py -> build\lib.win32-3.7\nacl\bindings copying src\nacl\bindings\crypto_hash.py -> build\lib.win32-3.7\nacl\bindings copying src\nacl\bindings\crypto_scalarmult.py -> build\lib.win32-3.7\nacl\bindings copying src\nacl\bindings\crypto_secretbox.py -> build\lib.win32-3.7\nacl\bindings copying src\nacl\bindings\crypto_sign.py -> build\lib.win32-3.7\nacl\bindings copying src\nacl\bindings\randombytes.py -> build\lib.win32-3.7\nacl\bindings copying src\nacl\bindings\sodium_core.py -> build\lib.win32-3.7\nacl\bindings copying src\nacl\bindings\__init__.py -> build\lib.win32-3.7\nacl\bindings running build_clib error: [WinError 193] %1 is not a valid Win32 application Command "C:\Users\alask\AppData\Local\Programs\Python\Python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\alask\\AppData\\Local\\Temp\\pip-install-5j_o21yf\\PyNaCl\\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\alask\AppData\Local\Temp\pip-record-c7xobe4i\install-record.txt --single-version-externally-managed --compile --home=C:\Users\alask\AppData\Local\Temp\pip-target-d9d4aa56" failed with error code 1 in C:\Users\alask\AppData\Local\Temp\pip-install-5j_o21yf\PyNaCl\ An error occurred and the requirements setup might not be completed. Consult the docs. Press enter to continue. ```
sweiner commented 2018-07-25 07:18:39 +02:00 (Migrated from github.com)

This issue seems to pop up when pip is installing discord.py[voice]. (I ran into it trying to use python 3.7... which FYI doesn't work for other reasons, so I had to downgrade to 3.5)

Here is a workaround I found.

  1. Manually download discord.py from
    https://files.pythonhosted.org/packages/97/3c/2a97b47fd8839f8863241857bbd6a3998d1de1662b788c8d9322e5a40901/discord.py-0.16.12.tar.gz
  2. Edit this line in the Red-DiscordBot requirements.txt
    git+git://github.com/Rapptz/discord.py.git#egg=discord.py[voice]
    to point to the downloaded directory with [voice] at the end. For example:
    C:\Users\you\Desktop\discord.py-0.16.12[voice]
  3. Edit this line in setup.py in the discord.py directory
extras_require = {
    'voice': ['PyNaCl==1.0.1'],
}

To

extras_require = {
    'voice': ['PyNaCl==1.2.1'],
}
  1. Run start_launcher.bat again from your Red-DiscordBot directory
This issue seems to pop up when pip is installing discord.py[voice]. (I ran into it trying to use python 3.7... which FYI doesn't work for other reasons, so I had to downgrade to 3.5) Here is a workaround I found. 1. Manually download discord.py from https://files.pythonhosted.org/packages/97/3c/2a97b47fd8839f8863241857bbd6a3998d1de1662b788c8d9322e5a40901/discord.py-0.16.12.tar.gz 2. Edit this line in the Red-DiscordBot requirements.txt `git+git://github.com/Rapptz/discord.py.git#egg=discord.py[voice]` to point to the downloaded directory with [voice] at the end. For example: `C:\Users\you\Desktop\discord.py-0.16.12[voice]` 3. Edit this line in setup.py in the discord.py directory ``` extras_require = { 'voice': ['PyNaCl==1.0.1'], } ``` To ``` extras_require = { 'voice': ['PyNaCl==1.2.1'], } ``` 4. Run start_launcher.bat again from your Red-DiscordBot directory
Tobotimus commented 2018-08-02 14:33:58 +02:00 (Migrated from github.com)

Do not run red V2 (or V3 yet, for that matter) on python 3.7. We clearly recommend python 3.5 in the docs, please make sure you've followed the installation steps correctly before seeking help. In future, first try resolving issues in the #support channel of our discord server: https://discord.gg/red.

Also, I do not recommend the above suggested workaround. Red works absolutely fine as it is as long as you use python 3.5.

Do not run red V2 (or V3 yet, for that matter) on python 3.7. We clearly recommend python 3.5 in the [docs](https://twentysix26.github.io/Red-Docs/red_install_windows/#software), please make sure you've followed the installation steps correctly before seeking help. In future, first try resolving issues in the #support channel of our discord server: https://discord.gg/red. Also, I do **not** recommend the above suggested workaround. Red works absolutely fine as it is as long as you use python 3.5.
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#1939
No description provided.