Durante a instalação do toga no Python 3.9.4, Windows 10, me deparei com erro na instalação do pacote pythonnet-2.5.2.tar.gz e pycparser-2.20-py2.py3-none-any.whl e consegui resolver conforme segue:
Log de erro
C:\Python\Sources>pip install toga
Collecting toga
Downloading toga-0.2.15-py3-none-any.whl (4.3 kB)
Collecting toga-winforms
Downloading toga_winforms-0.2.15-py3-none-any.whl (13 kB)
Collecting pythonnet
Downloading pythonnet-2.5.2.tar.gz (1.9 MB)
|████████████████████████████████| 1.9 MB 2.2 MB/s
Collecting toga-core>=0.2.15
Downloading toga_core-0.2.15-py3-none-any.whl (413 kB)
|████████████████████████████████| 413 kB 3.2 MB/s
Collecting colosseum>=0.1.6
Downloading colosseum-0.2.0-py3-none-any.whl (261 kB)
|████████████████████████████████| 261 kB 6.4 MB/s
Collecting pycparser
Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)
|████████████████████████████████| 112 kB 3.3 MB/s
Using legacy 'setup.py install' for pythonnet, since package 'wheel' is not installed.
Installing collected packages: pycparser, colosseum, toga-core, pythonnet, toga-winforms, toga
Running setup.py install for pythonnet ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users
\\Administrador\\AppData\\Local\\Temp\\pip-install-u3kxff6r\\pythonnet_92154425163b4c819b48363071d49231\\setup.py'
"'"'; __file__='"'"'C:\\Users\\Administrador\\AppData\\Local\\Temp\\pip-install-u3kxff6r\\pythonnet_92154425163b4c
819b48363071d49231\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__
) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\
n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Administrador\AppData\
Local\Temp\pip-record-mbawo0ql\install-record.txt' --single-version-externally-managed --compile --install-headers
'c:\python\Include\pythonnet'
cwd: C:\Users\Administrador\AppData\Local\Temp\pip-install-u3kxff6r\pythonnet_92154425163b4c819b48363071d
49231\
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: option --single-version-externally-managed not recognized
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python\python.exe' -u -c 'import io, os, sys, setuptools, token
ize; sys.argv[0] = '"'"'C:\\Users\\Administrador\\AppData\\Local\\Temp\\pip-install-u3kxff6r\\pythonnet_9215442516
3b4c819b48363071d49231\\setup.py'"'"'; __file__='"'"'C:\\Users\\Administrador\\AppData\\Local\\Temp\\pip-install-u
3kxff6r\\pythonnet_92154425163b4c819b48363071d49231\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__f
ile__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read
().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record
'C:\Users\Administrador\AppData\Local\Temp\pip-record-mbawo0ql\install-record.txt' --single-version-externally-ma
naged --compile --install-headers 'c:\python\Include\pythonnet' Check the logs for full command output.
C:\Python\Sources>pip install toga
Collecting toga
Using cached toga-0.2.15-py3-none-any.whl (4.3 kB)
Collecting toga-winforms
Using cached toga_winforms-0.2.15-py3-none-any.whl (13 kB)
Requirement already satisfied: toga-core>=0.2.15 in c:\python\lib\site-packages (from toga-winforms->toga) (0.2.15
)
Collecting pythonnet
Using cached pythonnet-2.5.2.tar.gz (1.9 MB)
Requirement already satisfied: colosseum>=0.1.6 in c:\python\lib\site-packages (from toga-core>=0.2.15->toga-winfo
rms->toga) (0.2.0)
Requirement already satisfied: pycparser in c:\python\lib\site-packages (from pythonnet->toga-winforms->toga) (2.2
0)
Using legacy 'setup.py install' for pythonnet, since package 'wheel' is not installed.
Installing collected packages: pythonnet, toga-winforms, toga
Running setup.py install for pythonnet ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users
\\Administrador\\AppData\\Local\\Temp\\pip-install-s7plpy38\\pythonnet_37c80c063cc24884bce7558b1edf8950\\setup.py'
"'"'; __file__='"'"'C:\\Users\\Administrador\\AppData\\Local\\Temp\\pip-install-s7plpy38\\pythonnet_37c80c063cc248
84bce7558b1edf8950\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__
) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\
n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Administrador\AppData\
Local\Temp\pip-record-retls16y\install-record.txt' --single-version-externally-managed --compile --install-headers
'c:\python\Include\pythonnet'
cwd: C:\Users\Administrador\AppData\Local\Temp\pip-install-s7plpy38\pythonnet_37c80c063cc24884bce7558b1ed
f8950\
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: option --single-version-externally-managed not recognized
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python\python.exe' -u -c 'import io, os, sys, setuptools, token
ize; sys.argv[0] = '"'"'C:\\Users\\Administrador\\AppData\\Local\\Temp\\pip-install-s7plpy38\\pythonnet_37c80c063c
c24884bce7558b1edf8950\\setup.py'"'"'; __file__='"'"'C:\\Users\\Administrador\\AppData\\Local\\Temp\\pip-install-s
7plpy38\\pythonnet_37c80c063cc24884bce7558b1edf8950\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__f
ile__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read
().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record
'C:\Users\Administrador\AppData\Local\Temp\pip-record-retls16y\install-record.txt' --single-version-externally-ma
naged --compile --install-headers 'c:\python\Include\pythonnet' Check the logs for full command output.
C:\Python\Sources>pip install toga
Collecting toga
Using cached toga-0.2.15-py3-none-any.whl (4.3 kB)
Collecting toga-winforms
Using cached toga_winforms-0.2.15-py3-none-any.whl (13 kB)
Requirement already satisfied: toga-core>=0.2.15 in c:\python\lib\site-packages (from toga-winforms->toga) (0.2.15
)
Collecting pythonnet
Using cached pythonnet-2.5.2.tar.gz (1.9 MB)
Requirement already satisfied: colosseum>=0.1.6 in c:\python\lib\site-packages (from toga-core>=0.2.15->toga-winfo
rms->toga) (0.2.0)
Requirement already satisfied: pycparser in c:\python\lib\site-packages (from pythonnet->toga-winforms->toga) (2.2
0)
Using legacy 'setup.py install' for pythonnet, since package 'wheel' is not installed.
Installing collected packages: pythonnet, toga-winforms, toga
Running setup.py install for pythonnet ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users
\\Administrador\\AppData\\Local\\Temp\\pip-install-bmgcmii_\\pythonnet_200c30b5cca545cb9a772e89a6f374d2\\setup.py'
"'"'; __file__='"'"'C:\\Users\\Administrador\\AppData\\Local\\Temp\\pip-install-bmgcmii_\\pythonnet_200c30b5cca545
cb9a772e89a6f374d2\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__
) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\
n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Administrador\AppData\
Local\Temp\pip-record-br7zpod6\install-record.txt' --single-version-externally-managed --compile --install-headers
'c:\python\Include\pythonnet'
cwd: C:\Users\Administrador\AppData\Local\Temp\pip-install-bmgcmii_\pythonnet_200c30b5cca545cb9a772e89a6f
374d2\
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: option --single-version-externally-managed not recognized
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python\python.exe' -u -c 'import io, os, sys, setuptools, token
ize; sys.argv[0] = '"'"'C:\\Users\\Administrador\\AppData\\Local\\Temp\\pip-install-bmgcmii_\\pythonnet_200c30b5cc
a545cb9a772e89a6f374d2\\setup.py'"'"'; __file__='"'"'C:\\Users\\Administrador\\AppData\\Local\\Temp\\pip-install-b
mgcmii_\\pythonnet_200c30b5cca545cb9a772e89a6f374d2\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__f
ile__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read
().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record
'C:\Users\Administrador\AppData\Local\Temp\pip-record-br7zpod6\install-record.txt' --single-version-externally-ma
naged --compile --install-headers 'c:\python\Include\pythonnet' Check the logs for full command output.
Solução
A primeira coisa que fiz foi limpar a pasta C:\Users\Administrador\AppData\Local\Temp
Observe que no meu caso estava com o usuário Administrador, e na sequência fiz update/install com os comandos a seguir:
> pip install pip --upgrade
Requirement already satisfied: pip in c:\python\lib\site-packages (21.1.1)
> pip install setuptools --upgrade
Espero que ajude, e se lhe ajudou comente!!!
Nenhum comentário:
Postar um comentário