Problems with installing Kivy on MacOS - python

I tried to install Kivy on my computer but unfortunately I failed.
I'm running MacOS (v10.13.4) and I have installed Cython successfully (v0.26).
I ran:
pip3 install kivy
Then the process starts and the following error occurs:
**Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/yl/kw3svt1x4rdfdjzsd5hds9_c0000gn/T/pip-req-build-869vs3u5/**.
Is it possible to fix it?
As asked in the comments I'm posting the complete error trace:
`**Command Collecting kivy
Using cached https://files.pythonhosted.org/packages/8c/49/5c22589099f9b7fd106502ee6634a6675e634d7553fede141a7606e6a92d/Kivy-1.10.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/yl/kw3svt1x4rdfdjzsd5hds9_c0000gn/T/pip-install-nowxhf43/kivy/setup.py", line 668, in <module>
base_flags = determine_base_flags()
File "/private/var/folders/yl/kw3svt1x4rdfdjzsd5hds9_c0000gn/T/pip-install-nowxhf43/kivy/setup.py", line 551, in determine_base_flags
xcode_dev = getoutput('xcode-select -p').splitlines()[0]
IndexError: list index out of range
Using distutils
Detected Cython version 0.26
This version of Cython is untested with Kivy. While this version may
work perfectly fine, it is possible that you may experience issues. If
you do have issues, please downgrade to a supported version. It is
best to use the newest supported version, 0.25.2, but the minimum
supported version is 0.23.
If your platform provides a Cython package, check if you can downgrade
to a supported version. Otherwise, uninstall the platform package and
install Cython via pip:
pip install -I Cython==0.25.2
User distribution detected, avoid portable command.
Using this graphics system: OpenGL ES 2
OSX framework used, force to x86_64 only
OSX ARCHFLAGS are: -arch x86_64
GStreamer framework not found, fallback on pkg-config
WARNING: A problem occurred while running pkg-config --libs --cflags gstreamer-1.0 (code 127)
b'/bin/sh: pkg-config: command not found\n'
Missing framework /Library/Frameworks/SDL2.framework
Missing framework /Library/Frameworks/SDL2_ttf.framework
Missing framework /Library/Frameworks/SDL2_image.framework
Missing framework /Library/Frameworks/SDL2_mixer.framework
SDL2 frameworks not found, fallback on pkg-config
WARNING: A problem occurred while running pkg-config --libs --cflags sdl2 SDL2_ttf SDL2_image SDL2_mixer (code 127)
b'/bin/sh: pkg-config: command not found\n'
WARNING: A problem occurred while running xcode-select -p (code 2)
b'xcode-select: error: unable to get active developer directory, use `sudo xcode-select --switch path/to/Xcode.app` to set one (or see `man xcode-select`)\n'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/yl/kw3svt1x4rdfdjzsd5hds9_c0000gn/T/pip-install-nowxhf43/kivy/**`

Related

Issue installing python bcrypt in Cygwin

I'm trying to install paramiko in Cygwin and one of the build dependencies is bcrypt.
I have rustc installed and I believe all of the supporting build libraries.
Pip is also updated to the latest.
$ pip --version
pip 22.2.2 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
I use the following pip command:
pip install bcrypt
And I get the following error output:
error: failed to run custom build command for `pyo3-build-config v0.15.2`
Caused by:
process didn't exit successfully: `C:\Cygwin64\tmp\pip-install-19d9dusl\bcrypt_117761e212a240d8804ceae0beeb39c1\src\_bcrypt\target\release\build\pyo3-build-config-2ef06b5f5d02e46b\build-script-build` (exit code: 1)
--- stdout
cargo:rerun-if-env-changed=PYO3_CONFIG_FILE
cargo:rerun-if-env-changed=PYO3_NO_PYTHON
cargo:rerun-if-env-changed=PYO3_PYTHON
--- stderr
error: failed to run the Python interpreter at /usr/bin/python.exe: The system cannot find the path specified. (os error 3)
warning: build failed, waiting for other jobs to finish...
cargo rustc --lib --message-format=json-render-diagnostics --manifest-path src/_bcrypt/Cargo.toml --release -v --features pyo3/abi3-py36 pyo3/extension-module -- --crate-type cdylib
=============================DEBUG ASSISTANCE=============================
If you are seeing a compilation error please try the following steps to
successfully install bcrypt:
1) Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2) Ensure you have a recent Rust toolchain installed. bcrypt requires
rustc >= 1.56.0.
Python: 3.8.12
platform: CYGWIN_NT-10.0-19044-3.3.5-341.x86_64-x86_64-64bit-WindowsPE
pip: n/a
setuptools: 65.3.0
setuptools_rust: 1.5.1
rustc: 1.63.0 (4b91a6ea7 2022-08-08)
=============================DEBUG ASSISTANCE=============================
error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path src/_bcrypt/Cargo.toml --release -v --features 'pyo3/abi3-py36 pyo3/extension-module' -- --crate-type cdylib` failed with code 101
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for bcrypt Failed to build bcrypt ERROR: Could not build wheels for bcrypt, which is required to install pyproject.toml-based projects
I check my python installation (python.exe) and it is installed at /usr/bin/python.exe.
$ ls /usr/bin/python*
/usr/bin/python.exe /usr/bin/python2.7.exe /usr/bin/python3.8-config
/usr/bin/python2-config /usr/bin/python3 /usr/bin/python3.8.exe
/usr/bin/python2.7-config /usr/bin/python3-config
So I am confused.....what is the issue? Why can't it find my python interpreter? Why is bcrypt not building and installing?
I'm guessing that Cygwin causes some compatibility issues here.
It looks like Cygwin has a package for this purpose, likely to avoid these issues:
https://cygwin.com/packages/summary/python36-bcrypt.html

Installing PyFTGL: distribution not found

I am trying to install PyFTGL, to display text in my OpenGL project.
I usually install libraries using pip, but
sudo pip3 install PyFTGL
returns the following error:
Could not find a version that satisfies the requirement PyFTGL (from versions:)
No matching distribution found for PyFTGL
I also tried easy_install after reading this wiki, but
sudo easy_install PyFTGL
returns the following error:
error: Could not find suitable distribution for Requirement.parse('PyFTGL')
What am I doing wrong ?
I am using python3.6 on my Macbook OSX Yosemite.
EDIT: after installing dependencies (FTGL, freetype, and boost-python) I still seem to miss a library.
I get the following error message when running the python setup.py install command from the source code directory:
ld: library not found for -lGLU
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang++' failed with exit status 1
Although I can already do this in python: from OpenGL.GLU import *

Issue with Boost and CMake on Mac Sierra when install dlib

So I've installed Boost via brew, similarly installed with cmake and python:
brew install boost --with-python3
brew install boost-python
brew install cmake
I'm currently using miniconda3 (python3.6) and am trying to install Dlib. So far I can install dlib fine, but when it comes to python setup, it fails. Dlib can be obtained by cloning the repo dlib_repo
Here I do python setup.py install, Getting the following errors
-- Detecting CXX compile features - done
CMake Warning at /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:1518 (message):
No header defined for python-py34; skipping header check
Call Stack (most recent call first):
/Users/userx/dlib/dlib/cmake_utils/add_python_module:61 (FIND_PACKAGE)
CMakeLists.txt:6 (include)
-- Could NOT find Boost
CMake Warning at /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:1518 (message):
No header defined for python-py35; skipping header check
Call Stack (most recent call first):
/Users/userx/dlib/dlib/cmake_utils/add_python_module:63 (FIND_PACKAGE)
CMakeLists.txt:6 (include)
-- Could NOT find Boost
CMake Warning at /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:1518 (message):
No header defined for python3; skipping header check
Call Stack (most recent call first):
/Users/userx/dlib/dlib/cmake_utils/add_python_module:66 (FIND_PACKAGE)
CMakeLists.txt:6 (include)
-- Boost version: 1.61.0
-- Found the following Boost libraries:
-- python3
-- Found PythonLibs: /Users/userx/miniconda3/lib/libpython3.5.dylib (found suitable version "3.5.2", minimum required is "3.4")
-- USING BOOST_LIBS: /Users/userx/miniconda3/lib/libboost_python3.dylib
-- USING PYTHON_LIBS: /Users/userx/miniconda3/lib/libpython3.5.dylib
...
...
...
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [dlib_build/CMakeFiles/dlib.dir/gui_widgets/fonts.cpp.o] Error 1
make[1]: *** [dlib_build/CMakeFiles/dlib.dir/all] Error 2
make: *** [all] Error 2
error: cmake build failed!
So here, I felt cmake couldn't find the boost variables, so I added these to my .bashrc and restarted my shell.
export BOOST_ROOT="/usr/local/Cellar/boost/1.63.0"
export BOOST_INCLUDE="/usr/local/Cellar/boost/1.63.0/include"
export BOOST_LIBDIR="/usr/local/Cellar/boost/1.63.0/lib"
Note these paths were found them via brew info and checked them to ensure correctness.
I'm using a macbook with Sierra OS - as I know Sierra has changed the way a lot of builds happen.
I have also tried to remove boost and download from the site and build directly, but same problem persists.
Any help much appreciated
It might be caused by the CMAKE_PREFIX_PATH setting.
I met the same problem and I solved it by this sequence:
First I install the boost using this:
brew install boost-python --with-python3
then I found the BOOST Not Found error when running the following commands to install the dlib 19.7.0:
pip install dlib --upgrade
So I edit the Bash Profile with following commands:
nano ~/.bash*le
and add the following line into this file:
export CMAKE_PREFIX_PATH="/usr/local:/usr/local/Cellar/boost/1.65.1:$PATH"
Notice
I am using the boost 1.65.1, which is installed at /usr/local/Cellar/boost/1.65.1, you might change it to the location that you install boost with brew.
after this step, I run pip install dlib --upgrade again on both python2.7.14 and 3.6.1 and 3.6.3, everything goes on the right way now.
I did the same in my system, except for one difference:
python3 setup.py install
Instead of
python setup.py install
And I don't see that error.

trying to install mercurial via easy_install

I am using Active Python 2.5.1, Mercurial 1.8.1 and TortoiseHg 1.1.0
on Windows XP (all x86)
I am trying to configure a mercurial repo in reviewboard. For that it
requires mercurial python module
So when i try to install mercurial via easy_install i get the
following error
C:\>easy_install mercurial==1.8.1
Searching for mercurial==1.8.1
Reading http://pypi.python.org/simple/mercurial/
Reading http://mercurial.selenic.com/
Reading http://www.selenic.com/mercurial
Reading http://mercurial.selenic.com/release/
Best match: mercurial 1.8.1
Downloading http://mercurial.selenic.com/release/mercurial-1.8.1.tar.gz
Processing mercurial-1.8.1.tar.gz
Running mercurial-1.8.1\setup.py -q bdist_egg --dist-dir c:
\docume~1\username\locals~1\temp\easy_install-7l0ykf
\mercurial-1.8.1\egg-dist-tmp-egcnt6
cc1.exe: error: unrecognized command line option '-mno-cygwin'
error: Setup script exited with error: command 'gcc' failed with exit
status 1
I have installed gcc through MinGW
Thanks shu zOMG chen, 1.8.1 is a requirement so can't really change that.The second link did help, but now there's another problem. After removing -mno-cygwin occurences from distutils\cygwinccompiler.py I ran easy_install mercurial==1.8.1. The trace is as folows :
C:\>easy_install mercurial==1.8.1
Searching for mercurial==1.8.1
Reading http://pypi.python.org/simple/mercurial/
Reading http://mercurial.selenic.com/
Reading http://www.selenic.com/mercurial
Reading http://mercurial.selenic.com/release/
Best match: mercurial 1.8.1
Downloading http://mercurial.selenic.com/release/mercurial-1.8.1.tar.gz
Processing mercurial-1.8.1.tar.gz
Running mercurial-1.8.1\setup.py -q bdist_egg --dist-dir c:\docume~1\username\locals~1\temp\easy_install-05el_6\mercurial-1.8.1\egg-dist-tmp-zsfye0
gcc: error: CreateProcess: No such file or directory
error: Setup script exited with error: command 'gcc' failed with exit status 1
C:\>
Please Help
Regards
From your output it appears that easy_install is trying to build mercurial with an option that requires some cygwin parts. If you're using mingw gcc you might want to look at https://www.mercurial-scm.org/wiki/BuildingOnWindows for instuctions on how to build in windows.
Is there a reason you're using 1.8.1? The latest version is 2.1.2.
Googling around, Compiling with cython and mingw produces gcc: error: unrecognized command line option '-mno-cygwin' might help you with this too.
There are also exe and msi installers for Windows at https://www.mercurial-scm.org/downloads.
In my opinion, the TortoiseXXX changes the mental picture of what is behind the wrapper. It was difficult for me to explain to my colleague how to work with CVS correctly when TortoiseCVS was used.
Off topic: For your own other purpose, try also Git instead (http://git-scm.com/) The idea is very similar. I guess the Git is going to win statistically.
The msysgit (Windows) is nice, the functionality is comparable with the original Linux one, the included Git Gui and gitk may have rather strange look (Tcl/Tk), but they are very good for the basic Git operations.

problems with easy_install pycrypto

I'm trying install pycrypto on osx with easy_install and I'm getting the following error:
easy_install pycrypto
Searching for pycrypto
Reading http://pypi.python.org/simple/pycrypto/
Reading http://pycrypto.sourceforge.net
Reading http://www.pycrypto.org/
Reading http://www.amk.ca/python/code/crypto
Best match: pycrypto 2.3
Downloading http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.3.tar.gz
Processing pycrypto-2.3.tar.gz
Running pycrypto-2.3/setup.py -q bdist_egg --dist-dir /var/folders/3D/3D07iptvHZuzuYaeQDMFIU+++TI/-Tmp-/easy_install-00HgRU/pycrypto-2.3/egg-dist-tmp-BWGYsg
warning: GMP library not found; Not building Crypto.PublicKey._fastmath.
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
src/MD2.c:134: fatal error: error writing to -: Broken pipe
compilation terminated.
lipo: can't open input file: /var/folders/3D/3D07iptvHZuzuYaeQDMFIU+++TI/-Tmp-//ccoXuPRo.out (No such file or directory)
error: Setup script exited with error: command 'gcc-4.2' failed with exit status 1
I have this in my ~/.bash_profile to address this very issue:
# Set compile flags to not try to compile for PPC (no longer supported by xcode 4)
# (this is required for eg building pycrypto)
export ARCHFLAGS="-arch i386 -arch x86_64"
Yes, it's a result of installing Xcode 4. It tries to build for ppc, although Xcode 4 no longer has the relevant bits for that. See this question for ways round it: https://superuser.com/questions/259278/python-2-6-1-pycrypto-2-3-pypi-package-broken-pipe-during-build
xCode 5.1
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pycrypto
Looks like this got a little more difficult with OSX 10.9. Here's the additional stuff I did:
brew install libffi
If you see the warning about how it's installed "keg-only", that means homebrew did not link it, so you'll need to provide some more info with export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig. At that point the install blows up because by default OSX now dies on warning flags, so suppress that behavior as well:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
Then you should be able to install with pip.

Categories