Unable to install pygame in GitHubActions workflow - python

In my GitHub Actions workflow, I have the following step:
run: |
pip3 install pygame
which results in following error:
Collecting pygame
Downloading pygame-1.9.6.tar.gz (3.2 MB)
ERROR: Command errored out with exit status 1:
command: /opt/hostedtoolcache/Python/3.9.0/x64/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kswqgf01/pygame/setup.py'"'"'; __file__='"'"'/tmp/pip-install-kswqgf01/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 /tmp/pip-pip-egg-info-zlsswybj
cwd: /tmp/pip-install-kswqgf01/pygame/
Complete output (12 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using UNIX configuration...
/bin/sh: 1: sdl-config: not found
/bin/sh: 1: sdl-config: not found
/bin/sh: 1: sdl-config: not found
Unable to run "sdl-config". Please make sure a development version of SDL is installed.
Hunting dependencies...
WARNING: "sdl-config" failed!
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Error: Process completed with exit code 1.
What is causing that error, and how can that be fixed so I can perform unit tests for my Python program?

This works for me:
name: install-pygame
on: [push]
jobs:
check-pygame:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
- uses: actions/setup-python#v2
with:
python-version: '3.6' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- run: |
python -m pip install --upgrade pip
python3 -m pip install pygame==2.0.0.dev12
Please check this topic and this instruction

Related

Unable to install nvidia dali in Windows 10

I am not able to install the Nvidia dali module in windows 10.
Inside anaconda I am executing the following command:
pip install nvidia-dali
and it is producing the following error:
ERROR: Command errored out with exit status 1:
command: 'C:\ProgramData\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-bsx79qn9\\nvidia-dali\\setup.py'"'"'; __file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-bsx79qn9\\nvidia-dali\\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\Admin\AppData\Local\Temp\pip-install-bsx79qn9\nvidia-dali\pip-egg-info'
cwd: C:\Users\Admin\AppData\Local\Temp\pip-install-bsx79qn9\nvidia-dali\
Complete output (18 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Admin\AppData\Local\Temp\pip-install-bsx79qn9\nvidia-dali\setup.py", line 150, in <module>
raise RuntimeError(open("ERROR.txt", "r").read())
RuntimeError:
###########################################################################################
The package you are trying to install is only a placeholder project on PyPI.org repository.
This package is hosted on NVIDIA Python Package Index.
This package can be installed as:
$ pip install nvidia-pyindex
$ pip install nvidia-dali
Please refer to NVIDIA DALI installation guide for instructions:
https://docs.nvidia.com/deeplearning/dali/user-guide/docs/installation.html
###########################################################################################
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
In the above error it is suggesting to visit the URL:
https://docs.nvidia.com/deeplearning/dali/user-guide/docs/installation.html
I am also following the instructions given in the URL but still, I am unable to install it.
Can anyone please suggest to me the correct way of installing Nvidia dali in a windows environment.
Nvidia dali is not supported in Windows: https://github.com/NVIDIA/DALI/issues/476#issuecomment-724551468
When you try to install you end up installing placeholder package from pipy

How to import pygame in gitpod?

This is a simple SudokuSolver App.
Project on GitHub
It's working perfectly. But when I try to run it in gitpod it's unable to import pygame.
Error:
gitpod /workspace/SudokuVizualizationBacktracking $ /home/gitpod/.pyenv/versions/3.8.2/bin/python /workspace/SudokuVizualizationBacktracking/GUI.py
Traceback (most recent call last):
File "/workspace/SudokuVizualizationBacktracking/GUI.py", line 1, in <module>
import pygame
ModuleNotFoundError: No module named 'pygame'
Can you please help me out? Thanks You.
In your .gitpod.yml you have configured the following init task:
$ pip3 install -r requirements.txt
Start your workspace by opening https://gitpod.io/#https://github.com/Deepak-dash007/SudokuVizualizationBacktracking and run this command in the terminal. You'll get the following output:
$ pip3 install -r requirements.txt
Collecting pygame
Downloading pygame-1.9.6.tar.gz (3.2 MB)
|████████████████████████████████| 3.2 MB 6.8 MB/s
ERROR: Command errored out with exit status 1:
command: /home/gitpod/.pyenv/versions/3.8.2/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-fgexue3e/pygame/setup.py'"'"'; __file__='"'"'/tmp/pip-install-fgexue3e/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 /tmp/pip-pip-egg-info-9lyba20o
cwd: /tmp/pip-install-fgexue3e/pygame/
Complete output (12 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using UNIX configuration...
/bin/sh: 1: sdl-config: not found
/bin/sh: 1: sdl-config: not found
/bin/sh: 1: sdl-config: not found
Hunting dependencies...
WARNING: "sdl-config" failed!
Unable to run "sdl-config". Please make sure a development version of SDL is installed.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Here you can see that sdl-config is missing. Google found this Stack Overflow answer that lists dependencies needed for pygame: https://stackoverflow.com/a/60990677/1364435
Change your image config in your .gitpod.yml to:
image:
file: .gitpod.Dockerfile
and added a new file .gitpod.Dockerfile that installs the dependencies linked in the other Stack Overflow post:
FROM gitpod/workspace-full-vnc
RUN sudo apt-get update && sudo apt-get install -y \
python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev python-numpy subversion libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev
Push everything and create a new Gitpod workspace. That's it.
You'll find a running repo here https://github.com/corneliusludmann/SudokuVizualizationBacktracking
I also created a Pull Request for you: https://github.com/Deepak-dash007/SudokuVizualizationBacktracking/pull/1

Pip error installing PyObjC-core on mac OS 10.13.6

Hi currently i had PyObjC-core as one of the dependencies in my requirements.txt file, when i try to run
pip install -r requirements.txt
it return the following error:
Collecting pyobjc-core==6.1
Using cached https://files.pythonhosted.org/packages/3a/80/0cdb2130b86a984e4765beb93135aa9c2120fd64be1a27e1c7cb31c719bc/pyobjc-core-6.1.tar.gz
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vj52r5i1/pyobjc-core/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vj52r5i1/pyobjc-core/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 /tmp/pip-install-vj52r5i1/pyobjc-core/pip-egg-info
cwd: /tmp/pip-install-vj52r5i1/pyobjc-core/
Complete output (2 lines):
running egg_info
error: PyObjC requires macOS to build
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I looked for solutions online but still haven't found any answers.
my pip version is 20.0.2 and running on python 3.7
I also had tried with manual install pip install pyobjc-core but still no luck
As mentioned also here https://github.com/asweigart/pyautogui/issues/381, I believe currently the only solution is installing an older release of pyautogui:
https://pypi.org/project/PyAutoGUI/0.9.50/#history.
For instance: pip3 install PyAutoGUI==0.9.48
I came here with a slightly different error when trying to pip install pyobjc-core latest (8.1) on MacOS 10.15.7. If you are seeing the following compilation error from gcc ...
Modules/objc/OC_PythonNumber.m:553:39: error: unused parameter 'zone' [-Werror,-Wunused-parameter]
... then I would refer you to [this issue] on github 1

ERROR: Command errored out with exit status 1:

i am installing connector of Psycopg2 but i am unable install, how do i install that successfully?
in using this command line to install:
pip install psycopg2
(test) C:\Users\Shree.Shree-PC\Desktop\projects\purchasepo>pip install psycopg2
Collecting psycopg2
Using cached https://files.pythonhosted.org/packages/84/d7/6a93c99b5ba4d4d22daa3928b983cec66df4536ca50b22ce5dcac65e4e71/psycopg2-2.8.4.tar
.gz
ERROR: Command errored out with exit status 1:
command: 'c:\users\shree.shree-pc\envs\test\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Shr
ee.Shree-PC\\AppData\\Local\\Temp\\pip-install-_bgz1zs9\\psycopg2\\setup.py'"'"'; __file__='"'"'C:\\Users\\Shree.Shree-PC\\AppData\\Local\\T
emp\\pip-install-_bgz1zs9\\psycopg2\\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\Shree.Shree-PC\AppData\Local\Temp\pip-
install-_bgz1zs9\psycopg2\pip-egg-info'
cwd: C:\Users\Shree.Shree-PC\AppData\Local\Temp\pip-install-_bgz1zs9\psycopg2\
Complete output (23 lines):
running egg_info
creating C:\Users\Shree.Shree-PC\AppData\Local\Temp\pip-install-_bgz1zs9\psycopg2\pip-egg-info\psycopg2.egg-info
writing C:\Users\Shree.Shree-PC\AppData\Local\Temp\pip-install-_bgz1zs9\psycopg2\pip-egg-info\psycopg2.egg-info\PKG-INFO
writing dependency_links to C:\Users\Shree.Shree-PC\AppData\Local\Temp\pip-install-_bgz1zs9\psycopg2\pip-egg-info\psycopg2.egg-info\depe
ndency_links.txt
writing top-level names to C:\Users\Shree.Shree-PC\AppData\Local\Temp\pip-install-_bgz1zs9\psycopg2\pip-egg-info\psycopg2.egg-info\top_l
evel.txt
writing manifest file 'C:\Users\Shree.Shree-PC\AppData\Local\Temp\pip-install-_bgz1zs9\psycopg2\pip-egg-info\psycopg2.egg-info\SOURCES.t
xt'
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
For further information please check the 'doc/src/install.rst' file (also at
<http://initd.org/psycopg/docs/install.html>).
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
command line is correct
path should be checked and perhaps psycopg2 needs a visual C ++ build tools update from https://visualstudio.microsoft.com/visual-cpp-build-tools/
I had this problem when I installed python 3.10.0
if you are using python 3.10:
currently psycopg doesn't support python 3.10
The current psycopg2 implementation supports:
1.Python versions from 3.6 to 3.9
2.PostgreSQL server versions from 7.4 to 13
3.PostgreSQL client library version from 9.1
source : https://www.psycopg.org/docs/install.html
and if you're using windows with any version of python but 3.10 please try install psycopg2 by running :
pip install psycopg2-binary

mkl_intel_thread.dll error while installing flopy package

This is my first time to install a python package.
I want to install flopy package
The path to anaconda3 at my PC is
C:\Users\user\AppData\Local\Continuum\anaconda3
Following this video, I typed in anaconda prompt
cd "C:\Users\user\AppData\Local\Continuum\anaconda3"
python -m pip install flopy
I got the following
Collecting flopy
Using cached https://files.pythonhosted.org/packages/65/f3/7d86d8d83e6d71a05557796d303604c24c9896743be861433471d576bbb7/flopy-3.2.12.zip
and this error window appeared
The ordinal 242 could not be located in the dynamic link library
c:\Users\user\AppData\Local\Continuum\anaconda3\Library\bin\mkl_intel_thread.dll.
In anconda prompt
ERROR: Command errored out with exit status 2:
command: 'C:\Users\user\AppData\Local\Continuum\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-p3cq3l3y\\flopy\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-p3cq3l3y\\flopy\\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 pip-egg-info
cwd: C:\Users\user\AppData\Local\Temp\pip-install-p3cq3l3y\flopy\
Complete output (2 lines):
INTEL MKL ERROR: The operating system cannot run %1. mkl_intel_thread.dll.
Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll.
----------------------------------------
ERROR: Command errored out with exit status 2: python setup.py egg_info Check the logs for full command output.
mkl_intel_thread_dll is in this path
where mkl_intel_thread.dll
C:\Users\user\AppData\Local\Continuum\anaconda3\Library\bin\mkl_intel_thread.dll
Any suggestions to fix this error will be highly appreciated
That video is old and just bad advice in terms of Conda best practice. FloPy is available on the Conda Forge channel in Anaconda Cloud, which can be installed with
conda install -c conda-forge flopy

Categories

Resources