failed to install python versions using pyenv on macos - python

I am trying to install python 3.8.5 using pyenv on my new MacBook Pro.
I was able to install pyenv successfully and confirmed it was working fine.
It is quite weird as I was able to install python 3.9.2 successfully using pyenv on my MacOS.
The problem arises when I tried to install another python version such as 3.8.5.
I get the error messages as below.
~ » pyenv install 3.8.5
python-build: use openssl#1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.8.5.tar.xz...
-> https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tar.xz
Installing Python-3.8.5...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
BUILD FAILED (OS X 11.2.2 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/gm/wv5zbtxx6gl2cbg9yszmxnzc0000gn/T/python-build.20210403160603.37920
Results logged to /var/folders/gm/wv5zbtxx6gl2cbg9yszmxnzc0000gn/T/python-build.20210403160603.37920.log
Last 10 log lines:
checking size of _Bool... 1
checking size of off_t... 8
checking whether to enable large file support... no
checking size of time_t... 8
checking for pthread_t... yes
checking size of pthread_t... 8
checking size of pthread_key_t... 8
checking whether pthread_key_t is compatible with int... no
configure: error: Unexpected output of 'arch' on OSX
make: *** No targets specified and no makefile found. Stop.
I tried to follow some ways to resolve the issue as described in
https://github.com/pyenv/pyenv/wiki/Common-build-problems (common build problem)
However, I get the same outcome each time I try to install python versions using pyenv.
I am new to MacOS, I would like to get some advice on this. Could anyone help on this?
Thank you very much!

the error you are facing may be caused by an older version of the xcode command line tool.
Please try typing and running the following command.It may change something.
xcode-select --install
LDFLAGS="-L$(xcrun --show-sdk-path)/usr/lib" pyenv install 3.8.5
I hope it works for you.

I installed first python 3.10.3 and the project which I was trying to execute requires python 2 for that reason I tried to install using pyenv install 2.7.9 but I got ld: symbol(s) not found for architecture i386. I fixed it installing.
brew install openssl readline sqlite3 xz zlib
as it is recommended in the documentation

Related

How to install a different version of Python on mac for a single project

I need to run python 3.6 but have 3.9 on my mac, which is running Big Sur. I followed the instructions on pyenv's github and then when I run
pyenv install 3.6.15
I get the following error.
python-build: use openssl#1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.0.tar.xz...
-> https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz
Installing Python-3.9.0...
python-build: use tcl-tk from homebrew
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
BUILD FAILED (OS X 11.6.1 using python-build 2.2.0-5-g54889eb8)
Inspect or clean up the working tree at /var/folders/77/93y4tp5x557ff0h_3f76bh5c0000gn/T/python-build.20211103180947.22099
Results logged to /var/folders/77/93y4tp5x557ff0h_3f76bh5c0000gn/T/python-build.20211103180947.22099.log
Last 10 log lines:
checking for --with-cxx-main=<compiler>... no
checking for clang++... no
configure:
By default, distutils will build C++ extension modules with "clang++".
If this is not intended, then set CXX on the configure command line.
checking for the platform triplet based on compiler characteristics... darwin
configure: error: internal configure error for the platform triplet, please file a bug report
make: *** No targets specified and no makefile found. Stop.
I have reinstalled the xcode command line tools, reinstalled every dependency that pyenv mentions, and have done a full software update on my mac. The same error continues to show up.
I am running version 11.6.1 of Big Sur and 2.2.0 of pyenv.
python is looking for a C compiler to build python from source. checking for clang++... no means that it can't find one. You can install one via brew, and then pass the path for it to the pyenv command:
brew install gcc
CC="$(brew --prefix gcc)/bin/gcc-12" pyenv install 3.6.15

How do I install python package tobii_research?

I am trying to install tobii_research for a project and I was following the instructions on http://developer.tobiipro.com/python/python-getting-started.html
I already have python 3.7.6 and pip 21.1.2 installed on my Mac.
When I run pip install tobii-research I get:
ERROR: Could not find a version that satisfies the requirement tobii_research (from versions: none)
ERROR: No matching distribution found for tobii-research
Was there something I forgot to install?
I can not for the life of me figure out how to install this manually either.
Help with pip, or installing manually would be greatly appreciated, but you might have to explain it to me like I am stupid.
Thanks in advance.
It appears that you are not running the correct python version for the versions of the package that are available. If you look at the wheel files available on the tobii-research Downloads page, the software is packaged for either python 2.7 or 3.6.
When trying to install this package myself, I get the same error message as you when trying to install it for python 3.8, but the package installs successfully with my python 2.7 installation.
I would recommend installing a compatible version of python and then running pip through that version using the following command:
[specific_python_installation] -m pip install tobii-research
Try doing it with pip again, but replace the underscore with a hyphen as shown below:
pip install tobii-research
I saw on the PyPi website that they only have it for Python 3.8, so I downloaded that Python version from their official website and installed it (do not add it to path).
Then, I created a virtual environment selecting 3.8 as the Python version (refer to this answer) and activated that virtual environment.
Finally, I run pip install tobii_research and it worked.
One thing that helped me - required Python version. For example, for the version 1.10.2 (which is current at the moment of writing this) only Python 3.10 is supported. Check the list of files distributed within this version.
I was able to install the package on Windows with Python 3.10 but on MacOS I had the same problem and wasn't able to resolve this - I assume it's a problem with the architecture, as there is no version for arm64 if you have a Mac with M1 processor.

pyenv and installing certain Python packages

I'm trying to install an older version of Python on my Mac. I'm currently running 2.7.9, but our production environment is running 2.7.6. (There is a compatibility issue with gevent and 2.7.9.)
I found pyenv which allows me to install various versions. I've installed pyenv with brew and installed 2.7.6. I then created a virtualenv with 2.7.6 with the following command:
mkvirtualenv my_env --python=/Users/dustin/.pyenv/versions/2.7.6/bin/python
It seems to work fine and I'm running Python 2.7.6. The problem I am running into is that I can't install certain packages with pip such as Cython or M2crypto. I get C compile errors.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
If I create a virtualenv without specifying the Python version, these packages install fine. How do I fix this?
It could be due to trying to run an older version of Python 2.7.x (like 2.7.6) on newer releases of OS X. If you are on OS X 10.10, that's very likely the problem. See http://bugs.python.org/issue21811. You may need to add at least the patch for _osx_support.py. If not, try running pip with -v and update your question with the results.
Update: With the additional information you supplied, it is clear that you are running into the OS X 10.10 support issues that were fixed in the changes for Issue21811 released in 2.7.8. In particular, the configure changes are needed to correctly parse the two-digit minor version number (10); otherwise, the code in configure mistakenly thinks you are are running on a very old version of OS X and generates obsolete link directives. You should backport https://hg.python.org/cpython/rev/2672e30d9095 and https://hg.python.org/cpython/rev/a7ab09e00dbc.

Python error when installing package using wheel files

I am trying to install pyHook with a wheel file (.whl) but for some reason it keeps giving me this error:
pyHook-1.5.1-cp34-none-win_amd64.whl is not a supported wheel on this platform.
I got the wheel file from this website:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
The command I use is:
pip install pyHook-1.5.1-cp34-none-win_amd64.whl
I have no idea what to do, I cant find any suggestions.
Python version 2.7
pip version 6.0.6
You are installing a Wheel created for Python 3.4, into Python 2.7. That won't work. Use the correct version and download the one with cp27 in the name:
pyHook‑1.5.1‑cp27‑none‑win_amd64.whl
I ran into the same issues whilst trying to install pyhook on Python 3.4. I downloaded the correct version from python software foundation.
I had to manually change the name of the file from pyHook_3k_compiled-1.5.1-cp34-cp34m-win_amd64.whl to pyHook-1.5.1-cp34-none-win_amd64.whl.
pip install pyHook-1.5.1-cp34-none-win_amd64.whl
And it worked!
You may not have installed the correct one for your operating system check whether it is the 32 bit or 64 bit variant and install it again

Robot Framework installation issue

Whenever i try to install Robot Framework. I am getting the error message below.
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
What is the issue?
I am installing robotframework-2.6.3.win32 with python2.7.2
I'm not sure what is causing your specific issue, but I find that using pip or easy_install works for installing robotframework and any plugins on windows
Do you change your installed Python folder name ? Please use internal set-up command line in Python for adding plugin.
I'm assuming from the win32 extension that this is for Windows. In which case I would suggest checking installing with pip which can be found in section 1.3.3
http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html
Check if pip is installed with your python version
pip --version
Else use below link to install
https://pip.pypa.io/en/stable/installing/
once pip is installed , you can try to install robotframework with specific version like below
pip install MySQL_python==1.2.2
I'm not sure the cause for your issue. but you are trying to install an older version of Robot framework on an Older python build. I suggest you to try a newer version such as 'Robot Framework 3.2.2 (Python 3.7.9 on win32)'. Then, it's easy since pip is installed by default if you are using Python 2 >=2.7.9 or Python 3 >=3.4. (you can check by > "py -m pip --version")
Installing Robot Framework is just a two-step process now.
install python from https://www.python.org/downloads/
install robotframework from https://pypi.org/project/robotframework/ > "pip install robotframework" (You can check the version by > "robot --version")
Read more - https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#installation-instructions

Categories

Resources