Cannot install Pyinstaller under Wine on Kali Linux - python

I am getting syntax error ERROR: Command errored out with exit status 1 ... while trying to install Pyinstaller under Wine on Kali Linux in a virtual environment
I'm getting an error as follows:
┌──(root㉿kali)-[~/.wine/drive_c/Python27/Scripts]
└─# wine ~/.wine/drive_c/Python27/python.exe -m pip install pyinstaller
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrt
Collecting pyinstaller
Using cached https://files.pythonhosted.org/packages/9e/ed/fbdad7f5d8f794c901076b814b8z
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Python27\python.exe' 'C:\Python27\lib\site-packages\pip\_vendor\pep517\_'
cwd: c:\users\root\temp\pip-install-87e3zr\pyinstaller
Complete output (19 lines):
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 207, in>
main()
File "C:\Python27\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 197, inn
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Python27\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 54, in l
return hook(config_settings)
File "c:\users\root\temp\pip-build-env-fbjbxm\overlay\Lib\site-packages\setuptools\bl
return self._get_build_requires(config_settings, requirements=['wheel'])
File "c:\users\root\temp\pip-build-env-fbjbxm\overlay\Lib\site-packages\setuptools\bs
self.run_setup()
File "c:\users\root\temp\pip-build-env-fbjbxm\overlay\Lib\site-packages\setuptools\bp
self).run_setup(setup_script=setup_script)
File "c:\users\root\temp\pip-build-env-fbjbxm\overlay\Lib\site-packages\setuptools\bp
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 63
file=sys.stderr)
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Python27\python.exe' 'C:\Python27\lib.
WARNING: You are using pip version 19.2.3, however version 20.3.4 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
I have python2 version 2.7.18 and python version 3.9.10 installed and pip 22.1.2 from /usr/local/lib/python3.9/dist-packages/pip. I have tried uninstalling and reinstalling Python, Wine but the error doesn't go away.

The latest PyInstaller version for Python2.7 is 3.6.
So you need to tell pip which PyInstaller version to install:
...python.exe -m pip install pyinstaller==3.6

Related

How to install setuptools for python based project (ModuleNotFoundError: No module named 'setuptools')?

I 've a running Django project created with poetry I 'm trying to install its dependencies using poetry install using python 3.9`
I 'm getting this error while installing
cwd: C:\Users\Lenovo\AppData\Local\Temp\pip-req-build-1hvchk7d\
Complete output (3 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'setuptools'
----------------------------------------
WARNING: Discarding file:///C:/Users/Lenovo/AppData/Local/pypoetry/Cache/artifacts/0c/05/66/5aa05d2bdbafe6e3783cd138cb601eb252fdcfc29ba618431cd24deeaa/drf-access-policy-1.3.0.tar.gz. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 21.1.2; however, version 22.3.1 is available.
You should consider upgrading via the 'C:\Users\Lenovo\AppData\Local\pypoetry\Cache\virtualenvs\vending-machine-api-l-EiZrwy-py3.9\Scripts\python.exe -m pip install --upgrade pip' command.
at ~\.poetry\lib\poetry\utils\env.py:1101 in _run
1097│ output = subprocess.check_output(
1098│ cmd, stderr=subprocess.STDOUT, **kwargs
1099│ )
1100│ except CalledProcessError as e:
→ 1101│ raise EnvCommandError(e, input=input_)
1102│
1103│ return decode(output)
1104│
1105│ def execute(self, bin, *args, **kwargs):
I 've tried these solution but none worked for me :
pip install --upgrade pip
pip install --upgrade wheel
pip install setuptools

Error with Dlib installation for python on windows 10

I'm trying to install dlib. I followed every single tip on the internet but its just not working.
I'm using/tried
windows 10
cmake 3.21.4 (it's on path)
python 3.8.12 and 3.6.4
conda 4.10.3
pip 21.3.1
visual studio 2019
components in vs (1)
components in vs (2)
I have conda and pip installed, tried both with
pip install dlib
pip install dlib --verbose
pip install "some urls"
conda install -c conda-forge dlib
conda install -c conda-forge/label/cf201901 dlib
The error I'm getting is:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\sophi\AppData\Local\Temp\pip-install-3w7lgrlb\dlib_ffabe5e6a08e472b835f598e7803e3d4\setup.py", line 222, in <module>
setup(
File "c:\users\sophi\anaconda3\lib\site-packages\setuptools\__init__.py", line 159, in setup
return distutils.core.setup(**attrs)
File "c:\users\sophi\anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\sophi\anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\sophi\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\sophi\anaconda3\lib\site-packages\setuptools\command\install.py", line 68, in run
return orig.install.run(self)
File "c:\users\sophi\anaconda3\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\sophi\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\sophi\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\sophi\anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\sophi\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\sophi\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\sophi\AppData\Local\Temp\pip-install-3w7lgrlb\dlib_ffabe5e6a08e472b835f598e7803e3d4\setup.py", line 134, in run
self.build_extension(ext)
File "C:\Users\sophi\AppData\Local\Temp\pip-install-3w7lgrlb\dlib_ffabe5e6a08e472b835f598e7803e3d4\setup.py", line 174, in build_extension
subprocess.check_call(cmake_build, cwd=build_folder)
File "c:\users\sophi\anaconda3\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1.
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1: 'c:\users\sophi\anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sophi\\AppData\\Local\\Temp\\pip-install-3w7lgrlb\\dlib_ffabe5e6a08e472b835f598e7803e3d4\\setup.py'"'"'; __file__='"'"'C:\\Users\\sophi\\AppData\\Local\\Temp\\pip-install-3w7lgrlb\\dlib_ffabe5e6a08e472b835f598e7803e3d4\\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\sophi\AppData\Local\Temp\pip-record-kvd3vwdq\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\sophi\anaconda3\Include\dlib' Check the logs for full command output.
For me, it seems like the problem is somethin with the cmake command, but I have no idea what the exact problem is. I used pip install cmake and installed cmake from source, none of both worked.
Has anyone an idea how to solve this?
This may be late response but I was facing the exact same issue when trying to install dlib on visual studio code. This was my error I was receiving when trying to run the command "pip install dlib"
Collecting dlib
Using cached dlib-19.23.1.tar.gz (7.4 MB)
Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for dlib, since package 'wheel' is not installed.
Installing collected packages: dlib
Running setup.py install for dlib ... error
error: subprocess-exited-with-error
× Running setup.py install for dlib did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
running install
running build
running build_py
package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
running build_ext
ERROR: CMake must be installed to build dlib
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> dlib
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
So my next approach was to install cmake which where the installation worked however I receive a warning that the file path to the exe was not added to my path. This resulted when running "cmake --version" to outputted in terminal
'cmake' is not recognized as an internal or external command,
operable program or batch file.
I would suspected to not run correctly, and to fix this I simply copy the path that it had printed out to my terminal after install cmake and went to
Advance System Settings -> Advanced Tab -> Environment Variables -> User Variables for 'your desktop name' open up "Path" -> click on new -> paste path
After following those steps running the command "cmake --version" correctly printed out the version install, meaning it is accessing the correct path. After that "pip install dlib" worked perfectly as proof below
Collecting dlib
Using cached dlib-19.23.1.tar.gz (7.4 MB)
Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for dlib, since package 'wheel' is not installed.
Installing collected packages: dlib
Running setup.py install for dlib ... done
Successfully installed dlib-19.23.1
I hope this may help as it is one approach that worked for me in installing dlib. As you mention your cmake is on path I would check by running the command to see if the version is correctly printing out.
Althoug trying to test every combination of the commands mentioned in my question, there apparently was one combination I didn't try:
Conda environment with python 3.6.4 and then
conda install -c conda-forge dlib
Not able to install dlib on Windows 10 and Python 3.7
As Berkay is mentioning, anaconda apparently requires python <=3.6.x, which solved it for me.
! pip install dlib would not work in this environment (probably because of another version problem with this environment) !

How to install pygame in Windows 10 for python 3.9?

I have tried everything
Here are some of the methods I have tried
C:\Users\win 10\AppData\Local\Programs\Python\Python39> python -m pip install pygame-1.9.6-cp27-cp27m-win_amd64.whl
The following error is prompted:
ERROR: pygame-1.9.6-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.
C:\Users\win 10\AppData\Local\Programs\Python\Python39> pip install pygame
The following error is prompted:
ERROR: Command errored out with exit status 1:
command: 'c:\users\win 10\appdata\local\programs\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\win 10\\AppData\\Local\\Temp\\pip-install-l782i464\\pygame\\setup.py'"'"';
__file__='"'"'C:\\Users\\win 10\\AppData\\Local\\Temp\\pip-install-l782i464\\pygame\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\win 10\AppData\Local\Temp\pip-pip-egg-info-1zl98t9z'
cwd: C:\Users\win 10\AppData\Local\Temp\pip-install-l782i464\pygame\
Complete output (17 lines):
**WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\win 10\AppData\Local\Temp\pip-install-l782i464\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\win 10\AppData\Local\Temp\pip-install-l782i464\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\win 10\AppData\Local\Temp\pip-install-l782i464\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\win 10\AppData\Local\Temp\pip-install-l782i464\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
What should I do?
You could use the pre-release version that supports Python 3.9.0.
python3 -m pip install pygame --pre --user
Many packages do not have pre-built wheels for Python 3.9 as it is new.
Also pygame-1.9.6-cp27-cp27m-win_amd64.whl is for Python 2.7
Your best bet is to revert to Python 3.8.6 to install pre-built wheel with pip
install pywin32 first ,pip install pywin32.
and then istall pygame pip install pygame
by doing this you shall be able to download it
This is the way i did it.
Open command prompt on windows and type:
py -m pip install -U pygame --user
Then afterwards to test it out try this small game:
py -m pygame.examples.aliens
With reference to #ViaxCo answer at above for pre-release version installation, which could be for Linux/ macOS, below is another option for Windows, in case 'python3' causing "python was not found error". My installed python version is 3.9.6
python -m pip install pygame --pre --user

Unable to install mysqlclient using pip3 on MacOS sierra

I want to use mysql in django so, trying to download mysqlclent using $ pip3 install mysqlclient but always this error comes up
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/hb/vmtpfjk12fdcm_8l95hfqzmr0000gn/T/pip-build-pm_wn_w8/mysqlclient/
here are my terminal logs
$ pip3 install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-1.3.9.tar.gz
Complete output from command python setup.py egg_info:
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/hb/vmtpfjk12fdcm_8l95hfqzmr0000gn/T/pip-build-pm_wn_w8/mysqlclient/setup.py", line 17, in <module>
metadata, options = get_config()
File "/private/var/folders/hb/vmtpfjk12fdcm_8l95hfqzmr0000gn/T/pip-build-pm_wn_w8/mysqlclient/setup_posix.py", line 44, in get_config
libs = mysql_config("libs_r")
File "/private/var/folders/hb/vmtpfjk12fdcm_8l95hfqzmr0000gn/T/pip-build-pm_wn_w8/mysqlclient/setup_posix.py", line 26, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/hb/vmtpfjk12fdcm_8l95hfqzmr0000gn/T/pip-build-pm_wn_w8/mysqlclient/
Please help
$ pip3 install mysqlclient
indicates that you are intending to use Python3 install the package. Based on the errors in the description, I believe that MySQL maybe missing from your machine. According to mysqlclient repo, MySQLConnectorC is one of the prerequisite to run mysqlclient on OSX.
brew install mysql-connector-c
should solve your issue.
Try adding MySQL to your PATH :
export PATH=${PATH}:/usr/local/mysql/bin/

pip install fuse-python: pkg-config unavailable, build terminated

I am trying to install python bindings for osx fuse with pip on osx 10.8.5. I am running python 2.7.2. I am running fuse 2.6.1. When I run the pip install command I get this error. I do not know how to debug it.
akh$ pip install fuse-python
Downloading/unpacking fuse-python
Downloading fuse-python-0.2.tar.gz (53kB): 53kB downloaded
Running setup.py egg_info for package fuse-python
pkg-config unavailable, build terminated
Complete output from command python setup.py egg_info:
pkg-config unavailable, build terminated
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /private/var/folders/hx/xb3zxftx6vlbd8nh1dbs6rc80000gn/T/pip_build_akh/fuse-python
Storing complete log in /Users/akh/Library/Logs/pip.log
Here is the tail of the log:
My Machine:Json akh$ tail 10 /Users/akh/Library/Logs/pip.log
tail: 10: No such file or directory
==> /Users/akh/Library/Logs/pip.log <==
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-1.4.1-py2.7.egg/pip/commands/install.py", line 236, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Library/Python/2.7/site-packages/pip-1.4.1-py2.7.egg/pip/req.py", line 1134, in prepare_files
req_to_install.run_egg_info()
File "/Library/Python/2.7/site-packages/pip-1.4.1-py2.7.egg/pip/req.py", line 259, in run_egg_info
command_desc='python setup.py egg_info')
File "/Library/Python/2.7/site-packages/pip-1.4.1-py2.7.egg/pip/util.py", line 670, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /private/var/folders/hx/xb3zxftx6vlbd8nh1dbs6rc80000gn/T/pip_build_abramhandler/fuse-python
I needed pck-config. Installing pck-config fixed the problem. These commands lead to a successful install.
brew install pkg-config
sudo pip install fuse-python

Categories

Resources