configure: error: Mesos requires Python < 3.0 - python

I want to install Mesos on Oracle Linux 8.3 which does not have Internet access. I followed the process exactly in its site in part CentOS 7.1 and installed some packages before building mesos. I installed these packages using rpm -i name of package:
glib2-2.56.4-156.el8.x86_64.rpm
glib2-2.56.4-8.el8.x86_64.rpm
glib2-devel-2.56.4-156.el8.x86_64.rpm
glib2-devel-2.56.4-8.el8.x86_64.rpm
libcurl-7.61.1-14.el8.x86_64.rpm
libcurl-devel-7.61.1-14.el8.x86_64.rpm
libsecret-devel-0.18.6-1.el8.x86_64.rpm
libserf-1.3.9-9.module_el8.4.0+632+d2bf8782.x86_64.rpm
pcre-8.42-4.el8.x86_64.rpm
pcre-cpp-8.42-4.el8.x86_64.rpm
pcre-devel-8.42-4.el8.x86_64.rpm
pcre-utf16-8.42-4.el8.x86_64.rpm
pcre-utf32-8.42-4.el8.x86_64.rpm
cyrus-sasl-md5-2.1.27-5.el8.x86_64.rpm
python2-2.7.15-24.el8.x86_64.rpm
python2-2.7.18-7.module_el8.5.0+894+1c54b371.x86_64.rpm
python2-devel-2.7.15-24.el8.x86_64.rpm
python2-libs-2.7.15-24.el8.x86_64.rpm
python2-libs-2.7.18-7.module_el8.5.0+894+1c54b371.x86_64.rpm
python2-pip-9.0.3-18.module_el8.4.0+642+1dc4fb01.noarch.rpm
python2-pip-wheel-9.0.3-18.module_el8.5.0+743+cd2f5d28.noarch.rpm
python2-setuptools-wheel-39.0.1-13.module_el8.5.0+743+cd2f5d28.noarch.rpm
sqlite-devel-3.26.0-11.el8.x86_64.rpm
subversion-1.10.2-4.module_el8.3.0+703+ba2f61b7.x86_64.rpm
subversion-devel-1.10.2-4.module_el8.3.0+703+ba2f61b7.x86_64.rpm
subversion-libs-1.10.2-4.module_el8.3.0+703+ba2f61b7.x86_64.rpm
utf8proc-2.1.1-5.module_el8.3.0+703+ba2f61b7.x86_64.rpm
zlib-devel-1.2.11-16.el8_2.x86_64.rpm
Also, I installed python2.7 in this way:
tar zxvf Python-2.7.15.tgz
./configure --enable-optimizations
make altinstall
After that I set its path in ~/.bashrc like this:
alias python=/usr/local/bin/python2.7
export PATH=$PATH:/usr/local/bin/python2.7
For its pip also I run this command:
python2.7 -m ensurepip --default-pip
When I run python --version it show me Python 2.7.15.
Again extract Mesos folder and create build directory, then run ../configure; but I receive the same error before installing python 2.7.15:
configure: error: Mesos requires Python < 3.0
-------------------------------------------------------------------
The detected Python version is 3.6.
If you already have Python 2.6+ installed (and it's the default python on the path), you might want to check if you have the PYTHON environment variable set to a version of Python greater than 3.0.
However, when I run python command and receive this result which show that python 2.7.15 is default, mesos recognize python 3.6:
Python 2.7.15 (default, Sep 10 2022, 16:33:49)
Output of printenv:
LD_LIBRARY_PATH=/opt/oracle/instantclient_21_4:/opt/oracle/instantclient_21_4:/opt/oracle/instantclient_21_4:
LS_COLORS=rs=0:di=38;5;33:ln=38;5;51:mh=00:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=01;05;37;41:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;40:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.zst=38;5;9:*.tzst=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.wim=38;5;9:*.swm=38;5;9:*.dwm=38;5;9:*.esd=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.mjpg=38;5;13:*.mjpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.m4a=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.oga=38;5;45:*.opus=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:
LC_MEASUREMENT=az_IR
M2_HOME=/usr/local/maven
SSH_CONNECTION=x.x.x.x 57648 xx.xx.xx.xx 22
LC_PAPER=az_IR
LC_MONETARY=az_IR
LANG=en_US.UTF-8
HISTCONTROL=ignoredups
HOSTNAME=kr311
OLDPWD=/root/Downloads/mesos/mesos-1.11.0
JAVA_HOME=/opt/oracle/java/jdk1.8.0_25
S_COLORS=auto
LC_NAME=az_IR
XDG_SESSION_ID=2
USER=root
PYSPARK_HOME=/usr/bin/python3.8
SELINUX_ROLE_REQUESTED=
PWD=/root/Downloads/mesos/mesos-1.11.0/build
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
HOME=/root
SSH_CLIENT=x.x.x.x 57648 22
SELINUX_LEVEL_REQUESTED=
XDG_DATA_DIRS=/root/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
LC_ADDRESS=az_IR
SPARK_HOME=/opt/spark
LC_NUMERIC=az_IR
SSH_TTY=/dev/pts/0
MAIL=/var/spool/mail/root
TERM=xterm-256color
SHELL=/bin/bash
SELINUX_USE_CURRENT_RANGE=
PYSPARK_DRIVER_PYTHON=python3.8
SHLVL=1
LC_TELEPHONE=az_IR
LOGNAME=root
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus
XDG_RUNTIME_DIR=/run/user/0
PYSPARK_PYTHON=/usr/bin/python3.8
PATH=/opt/oracle/instantclient_21_4:/opt/oracle/java/jdk1.8.0_25/bin:/opt/oracle/instantclient_21_4:/usr/local/bin/python2.7:/opt/oracle/java/jdk1.8.0_25/bin:/opt/oracle/instantclient_21_4:/opt/oracle/java/jdk1.8.0_25/bin:/usr/local/maven/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/bin/python2.7:/opt/spark/bin:/opt/spark/sbin:/root/bin:/opt/spark/bin:/opt/spark/sbin:/usr/local/bin/python2.7:/opt/spark/bin:/opt/spark/sbin
LC_IDENTIFICATION=az_IR
HISTSIZE=1000
LESSOPEN=||/usr/bin/lesspipe.sh %s
LC_TIME=az_IR_=/usr/bin/printenv
Would you please guide me what is wrong here?
Any help is really appreciated.

Related

How do I check all pip packages for packages installed globally using sudo? [duplicate]

Is there a way in Python to list all installed packages and their versions?
I know I can go inside python/Lib/site-packages and see what files and directories exist, but I find this very awkward. What I'm looking for something that is similar to npm list i.e. npm-ls.
If you have pip install and you want to see what packages have been installed with your installer tools you can simply call this:
pip freeze
It will also include version numbers for the installed packages.
Update
pip has been updated to also produce the same output as pip freeze by calling:
pip list
Note
The output from pip list is formatted differently, so if you have some shell script that parses the output (maybe to grab the version number) of freeze and want to change your script to call list, you'll need to change your parsing code.
help('modules') should do it for you.
in IPython :
In [1]: import #import press-TAB
Display all 631 possibilities? (y or n)
ANSI audiodev markupbase
AptUrl audioop markupsafe
ArgImagePlugin avahi marshal
BaseHTTPServer axi math
Bastion base64 md5
BdfFontFile bdb mhlib
BmpImagePlugin binascii mimetools
BufrStubImagePlugin binhex mimetypes
CDDB bisect mimify
CDROM bonobo mmap
CGIHTTPServer brlapi mmkeys
Canvas bsddb modulefinder
CommandNotFound butterfly multifile
ConfigParser bz2 multiprocessing
ContainerIO cPickle musicbrainz2
Cookie cProfile mutagen
Crypto cStringIO mutex
CurImagePlugin cairo mx
DLFCN calendar netrc
DcxImagePlugin cdrom new
Dialog cgi nis
DiscID cgitb nntplib
DistUpgrade checkbox ntpath
If you want to get information about your installed python distributions and don't want to use your cmd console or terminal for it, but rather through python code, you can use the following code (tested with python 3.4):
import pip #needed to use the pip functions
for i in pip.get_installed_distributions(local_only=True):
print(i)
The pip.get_installed_distributions(local_only=True) function-call returns an iterable and because of the for-loop and the print function the elements contained in the iterable are printed out separated by new line characters (\n).
The result will (depending on your installed distributions) look something like this:
cycler 0.9.0
decorator 4.0.4
ipykernel 4.1.0
ipython 4.0.0
ipython-genutils 0.1.0
ipywidgets 4.0.3
Jinja2 2.8
jsonschema 2.5.1
jupyter 1.0.0
jupyter-client 4.1.1
#... and so on...
To run this in later versions of pip (tested on pip==10.0.1) use the following:
from pip._internal.operations.freeze import freeze
for requirement in freeze(local_only=True):
print(requirement)
My take:
#!/usr/bin/env python3
import pkg_resources
dists = [str(d).replace(" ","==") for d in pkg_resources.working_set]
for i in dists:
print(i)
from command line
python -c help('modules')
can be used to view all modules, and for specific modules
python -c help('os')
For Linux below will work
python -c "help('os')"
For easy_install (deprecated, Python <= v2.7, do not use this, use pip instead; use this only in old projects that still use easy_install)
You can try : Yolk
For install yolk, try:
easy_install yolk
Yolk is a Python tool for obtaining information about installed Python
packages and querying packages avilable on PyPI (Python Package
Index).
You can see which packages are active, non-active or in development
mode and show you which have newer versions available by querying
PyPI.
yes! you should be using pip as your python package manager ( http://pypi.python.org/pypi/pip )
with pip installed packages, you can do a
pip freeze
and it will list all installed packages. You should probably also be using virtualenv and virtualenvwrapper. When you start a new project, you can do
mkvirtualenv my_new_project
and then (inside that virtualenv), do
pip install all_your_stuff
This way, you can workon my_new_project and then pip freeze to see which packages are installed for that virtualenv/project.
for example:
➜ ~ mkvirtualenv yo_dude
New python executable in yo_dude/bin/python
Installing setuptools............done.
Installing pip...............done.
virtualenvwrapper.user_scripts creating /Users/aaylward/dev/virtualenvs/yo_dude/bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/aaylward/dev/virtualenvs/yo_dude/bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/aaylward/dev/virtualenvs/yo_dude/bin/preactivate
virtualenvwrapper.user_scripts creating /Users/aaylward/dev/virtualenvs/yo_dude/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/aaylward/dev/virtualenvs/yo_dude/bin/get_env_details
(yo_dude)➜ ~ pip install django
Downloading/unpacking django
Downloading Django-1.4.1.tar.gz (7.7Mb): 7.7Mb downloaded
Running setup.py egg_info for package django
Installing collected packages: django
Running setup.py install for django
changing mode of build/scripts-2.7/django-admin.py from 644 to 755
changing mode of /Users/aaylward/dev/virtualenvs/yo_dude/bin/django-admin.py to 755
Successfully installed django
Cleaning up...
(yo_dude)➜ ~ pip freeze
Django==1.4.1
wsgiref==0.1.2
(yo_dude)➜ ~
or if you have a python package with a requirements.pip file,
mkvirtualenv my_awesome_project
pip install -r requirements.pip
pip freeze
will do the trick
If you're using anaconda:
conda list
will do it! See: https://conda.io/docs/_downloads/conda-cheatsheet.pdf
Here's a way to do it using PYTHONPATH instead of the absolute path of your python libs dir:
for d in `echo "${PYTHONPATH}" | tr ':' '\n'`; do ls "${d}"; done
[ 10:43 Jonathan#MacBookPro-2 ~/xCode/Projects/Python for iOS/trunk/Python for iOS/Python for iOS ]$ for d in `echo "$PYTHONPATH" | tr ':' '\n'`; do ls "${d}"; done
libpython2.7.dylib pkgconfig python2.7
BaseHTTPServer.py _pyio.pyc cgitb.pyo doctest.pyo htmlentitydefs.pyc mimetools.pyc plat-mac runpy.py stringold.pyc traceback.pyo
BaseHTTPServer.pyc _pyio.pyo chunk.py dumbdbm.py htmlentitydefs.pyo mimetools.pyo platform.py runpy.pyc stringold.pyo tty.py
BaseHTTPServer.pyo _strptime.py chunk.pyc dumbdbm.pyc htmllib.py mimetypes.py platform.pyc runpy.pyo stringprep.py tty.pyc
Bastion.py _strptime.pyc chunk.pyo dumbdbm.pyo htmllib.pyc mimetypes.pyc platform.pyo sched.py stringprep.pyc tty.pyo
Bastion.pyc _strptime.pyo cmd.py
....
for using code, for example to check what modules in Hackerrank etc :
import os
os.system("pip list")
If this is needed to run from within python you can just invoke subprocess
from subprocess import PIPE, Popen
pip_process = Popen(["pip freeze"], stdout=PIPE,
stderr=PIPE, shell=True)
stdout, stderr = pip_process.communicate()
print(stdout.decode("utf-8"))
For Windows 10, I think this is what you are looking for a list of available installed Pythons. This is different from a list of packages as you can see below. Also, on Ubuntu 20.04, I think the command is Python3 -0 list.
Yes, this works similar to node version manager.
c:\Users\user\AppData\Local\Programs\Python>py -0 list
Python 0 not found!
Installed Pythons found by py Launcher for Windows
-3.10-64 *
-3.9-64
-3.7-64
-3.6-64
-2.7-64
Requested Python version (0) not installed, use -0 for available pythons
c:\Users\user\AppData\Local\Programs\Python>py -0p
Installed Pythons found by py Launcher for Windows
-3.10-64 C:\Python310\python.exe *
-3.9-64 C:\Users\user\AppData\Local\Programs\Python\Python39\python.exe
-3.7-64 C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python.exe
-3.6-64 C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\python.exe
-2.7-64 C:\Python27amd64\python.exe
See: https://www.infoworld.com/article/3617292/how-to-use-pythons-py-launcher-for-windows.html
See Also: https://www.freecodecamp.org/news/manage-multiple-python-versions-and-virtual-environments-venv-pyenv-pyvenv-a29fb00c296f/
From the above link, "If you wish to use multiple versions of Python on a single machine, then pyenv is a commonly used tool to install and switch between versions. This is not to be confused with the previously mentioned depreciated pyvenv script. It does not come bundled with Python and must be installed separately." -- Note: This acts similar to Node Version Manager with versions of Node.js and NPM.
See Also: https://github.com/pyenv-win/pyenv-win#installation
Action: Open PowerShell and type the following web request. The link above offers other approaches as well, but this appears to be the easiest approach. The name of the runtime output file is not a name variant like 'pyenv-win' but actually 'pyenv', as originally expected.
PS C:\Users\user> Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1"; &"./install-pyenv-win.ps1"
pyenv-win 2.64.11 installed.
No updates available.
PS C:\Users\user>
Example Output for working with 'pyenv', Python's Version Manager.
C:\Users\user>pyenv --version
pyenv 2.64.11
C:\Users\name>pyenv
pyenv 2.64.11
Usage: pyenv <command> [<args>]
Some useful pyenv commands are:
commands List all available pyenv commands
duplicate Creates a duplicate python environment
local Set or show the local application-specific Python version
global Set or show the global Python version
shell Set or show the shell-specific Python version
install Install a Python version using python-build
uninstall Uninstall a specific Python version
update Update the cached version DB
rehash Rehash pyenv shims (run this after installing executables)
vname Show the current Python version
version Show the current Python version and its origin
version-name Show the current Python version
versions List all Python versions available to pyenv
exec Runs an executable by first preparing PATH so that the selected Python
which Display the full path to an executable
whence List all Python versions that contain the given executable
See `pyenv help <command>' for information on a specific command.
For full documentation, see: https://github.com/pyenv-win/pyenv-win#readme
C:\Users\name>pyenv commands
--version
commands
duplicate
exec
export
global
help
install
local
rehash
shell
shims
uninstall
update
version-name
version
versions
vname
whence
which
C:\Users\name>pyenv version
No global python version has been set yet. Please set the global version by typing:
pyenv global 3.7.2
C:\Users\user>pyenv local
no local version configured for this directory
C:\Users\user>pyenv global
no global version configured
C:\Users\user>pyenv local 3.9-64
pyenv specific python requisite didn't meet. Project is using different version of python.
Install python '3.9-64' by typing: 'pyenv install 3.9-64'
My Note: Version name from 'https://www.python.org/downloads/' is different to those provided by 'pyenv'. This version was already installed locally, but it is outside the control of this Python version manager, so it is not visible to the manager.
C:\Users\user>pyenv install 3.8.10-64
:: [Info] :: Mirror: https://www.python.org/ftp/python
pyenv-install: definition not found: local
My Note(s): This Python version is not part of the managed list although this version exists at 'https://www.python.org/downloads/'. So you must see the list provided by the manager. See all available versions with `pyenv install --list'.
C:\Users\user>pyenv install --list
Note: Review the list from this call and make your selection.
C:\Users\user>pyenv install 3.8.10
:: [Info] :: Mirror: https://www.python.org/ftp/python
:: [Downloading] :: 3.8.10 ...
:: [Downloading] :: From https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64-webinstall.exe
:: [Downloading] :: To C:\Users\user\.pyenv\pyenv-win\install_cache\python-3.8.10-amd64-webinstall.exe
:: [Installing] :: 3.8.10 ...
:: [Info] :: completed! 3.8.10
My Note(s): With this Python version manager, 'pyenv', following installation, it appears that one must designate the version as 'local' or 'global' after the installation which would follow the same paradigm as the Node.js Version Manager (NVM). Again, from what I can see, the Python version manager can only see what versions of Python the manager installs; and it can only uninstall a version it has installed with the Python version manager.
C:\Users\user>pyenv local 3.8.10
C:\Users\user>pyenv local
3.8.10
C:\Users\user>pyenv version
3.8.10 (set by C:\Users\user\.python-version)
C:\Users\user>pyenv versions
* 3.8.10 (set by C:\Users\user\.python-version)
C:\Users\user>pyenv vname
3.8.10
C:\Users\user>pyenv global
no global version configured
The following below is for working with packages.
See Also: https://www.freecodecamp.org/news/manage-multiple-python-versions-and-virtual-environments-venv-pyenv-pyvenv-a29fb00c296f/
From the above link, "When the environment is active, any packages can be installed to it via pip as normal. By default, the newly created environment will not include any packages already installed on the machine. As pip itself will not necessarily be installed on the machine. It is recommended to first upgrade pip to the latest version, using 'pip install --upgrade pip'." -- I performed the pip upgrade just before making these two calls to list the packages and their versions below.
c:\Users\user\AppData\Local\Programs\Python>pip list
Package Version
---------- -------
pip 22.1
setuptools 62.2.0
wheel 0.37.1
c:\Users\user\AppData\Local\Programs\Python>pip list --local
Package Version
---------- -------
pip 22.1
setuptools 62.2.0
wheel 0.37.1

Tox not finding python3.6 even with the shim present. What is wrong with my pyenv setup?

Trying to breathe some life back into a django package that has fallen into a state of disrepair. They use tox for testing so I've setup pyenv on my MacBook. I've installed 3 versions of python as you can see below, and everything looks like it should work, but if it was I wouldn't be asking why it is not.
I've replaced my home directory with ~ to make it a bit easier to read.
pyenv was installed with brew install pyenv and the various versions of python were installed with pyenv install #.#.#
The shims exist:
$ echo $PATH
~/.pyenv/shims:~/.platformsh/bin:/usr/local/sbin:...
$ which python3.6
~/.pyenv/shims/python3.6
$ which python3.4
~/.pyenv/shims/python3.4
$ which python3.5
~/.pyenv/shims/python3.5
But executing them does not work as expected:
$ pyenv local 3.4.9 3.5.6 3.6.8
$ python3.4
Python 3.4.9 (default, Feb 12 2019, 10:33:47)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
$ python3.5
pyenv: python3.5: command not found
The `python3.5' command exists in these Python versions:
3.5.6
$ python3.6
pyenv: python3.6: command not found
The `python3.6' command exists in these Python versions:
3.6.8
And tox fails like this:
py34-1.11: commands succeeded
ERROR: py36-1.11: Error creating virtualenv. Note that some special characters (e.g. ':' and unicode symbols) in paths are not supported by virtualenv. Error details: InvocationError("Failed to get version_info for python3.6: pyenv: python3.6: command not found\n\nThe `python3.6' command exists in these Python versions:\n 3.6.8\n\n", None)
ERROR: py36-2.0: Error creating virtualenv. Note that some special characters (e.g. ':' and unicode symbols) in paths are not supported by virtualenv. Error details: InvocationError("Failed to get version_info for python3.6: pyenv: python3.6: command not found\n\nThe `python3.6' command exists in these Python versions:\n 3.6.8\n\n", None)
py36-latest: commands succeeded
docs: commands succeeded
But in the .tox folder you will find these VirtualEnvs that can be activated manually.
$ ls .tox
dist docs flake8 log py34-1.11 py36-1.11 py36-2.0 py36-latest
Because at some point it was working....
I do understand the mechanics of why it isn't working, what I don't understand is why pyenv is not setting up the environment correctly (Or maybe this is exactly how it is supposed to behave). Everything I read seems to indicate that python3.6 should launch a python3.6.8 interpreter
$ bash -x python3.6
+ set -e
+ '[' -n '' ']'
+ program=python3.6
+ [[ python3.6 = \p\y\t\h\o\n* ]]
+ export PYENV_ROOT=~/.pyenv
+ PYENV_ROOT=~/.pyenv
+ exec /usr/local/Cellar/pyenv/1.2.9/libexec/pyenv exec python3.6
pyenv: python3.6: command not found
The `python3.6' command exists in these Python versions:
3.6.8
pyenv by default picks the python "locally", that is it looks for the PYTHON_VERSION environment variable or a .python-version file.
Personally I find this setup a little cumbersome (needing to have these files littered around all projects, especially in projects which need multiple versions). Fortunately, you can make these "shims" function anywhere with a default version of python by using pyenv global #.#.#
In your case, to make the python3.6 shim execute 3.6.8 without needing to set up the .python-version files, you'd run pyenv global 3.6.8 -- you can run this multiple times for different python versions as well: pyenv global 3.6.8 3.5.6 ...
The reason that you're likely not having these resolve inside tox is tox clears the environment when executing, so the PYTHON_VERSION environment variable will not carry through. You can turn that off by setting passenv= in your tox.ini. For example:
[testenv]
passenv = PYTHON_VERSION

Install ROS Kinetic on MacOS under a separate Anaconda environment

I'm installing ROS Kinetic on MacOS Sierra 10.12.6 under a seperate environment under Python Anaconda distribution.
Here is my python version(my seperate python environment in Anaconda is called "ros-kinetic"):
(ros-kinetic) jizhe#jizhedeMacBook-Pro  ~/ros_catkin_ws  python --version
Python 3.6.4 :: Anaconda, Inc.
I followed the guide: http://wiki.ros.org/kinetic/Installation/OSX/Homebrew/Source.
When I execute the "rosdep install" command, I got the following error:
(ros-kinetic) jizhe#jizhedeMacBook-Pro ~/ros_catkin_ws  rosdep install --from-paths src --ignore-src --rosdistro kinetic -y
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
actionlib: No definition of [python-wxtools] for OS [osx]
catkin: No definition of [google-mock] for OS [osx]
roslisp: No definition of [google-mock] for OS [osx]
Obviously, there is something wrong with the package "python-wxtools" and "google-mock".
I've already install the wxpython via "brew install wxpython", and here is the wxpython info:
(ros-kinetic) jizhe#jizhedeMacBook-Pro  ~/ros_catkin_ws  brew info wxpython
wxpython: stable 3.0.2.0 (bottled)
Python bindings for wxWidgets
https://www.wxwidgets.org/
/usr/local/Cellar/wxpython/3.0.2.0_1 (1,108 files, 37.9MB) *
Poured from bottle on 2018-02-24 at 03:56:21
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/wxpython.rb
==> Dependencies
Required: wxmac ✔
==> Caveats
Python modules have been installed and Homebrew's site-packages is not
in your Python sys.path, so you will not be able to import the modules
this formula installed. If you plan to develop with these modules,
please run:
mkdir -p /Users/jizhe/Library/Python/2.7/lib/python/site-packages
echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/jizhe/Library/Python/2.7/lib/python/site-packages/homebrew.pth
And I've already run the command:
$ mkdir -p ~/Library/Python/2.7/lib/python/site-packages
$ echo "$(brew --prefix)/lib/python2.7/site-packages" >> ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth
So, what's wrong with the package "google-mock" and "python-wxtools", how can I solve this problem?
Try installing with --skip-keys python-wxtools --skip-keys google-mock. It worked for me.
There is a ticket for this issue. Basically the workaround is to install googletest manually. Not sure what's wrong with python-wxtools.
edit: If you're using ros-install-osx, you can add the following lines to your rosdeps.yaml file:
google-mock:
osx:
homebrew:
packages: []
I found this question from a Google search, just for your information in 2021 installing ROS in conda also on macOS should be much straightforward, see the following links:
https://medium.com/robostack/cross-platform-conda-packages-for-ros-fa1974fd1de3
https://github.com/RoboStack/ros-noetic

Trouble creating a virtualenv for python3 on OS X

I'm having a strange problem with a virtualenv I've created for python 3. I went through the usual steps:
$ virtualenv --python=/opt/local/bin/python3.3 .py3
$ source .py3/bin/activate
The problem I'm having is that when I call python --version, it is still reporting 2.7.5, even though the paths all appear to be set up correctly. My virtualenv was created in /Users/barry.flinn/projects/.py3/bin, and I get thes results when I run which python:
$ which python
/Users/barry.flinn/projects/.py3/bin/python
The bin folder has the following python executables:
lrwxr-xr-x 1 barry.flinn obfuscated\Domain Users 9 Sep 23 19:39 python -> python3.3
lrwxr-xr-x 1 barry.flinn obfuscated\Domain Users 9 Sep 23 19:39 python3 -> python3.3
-rwxr-xr-x 1 barry.flinn obfuscated\Domain Users 9100 Sep 23 19:39 python3.3
Clearly, invoking python should give me python 3.3, and yet it still seems to revert to the system python, which is 2.7.5. My $PATH when the virtualenv is active is:
/Users/barry.flinn/projects/.py3/bin:/usr/local/mysql/bin:/opt/local/lib/postgresql92/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/go/bin:/usr/local/munki
Since all of this seems correct, I'm stumped as to what is going on here.
Update:
This reports correctly:
$ env python --version
Python 3.3.2
Which, to me, is slightly more baffling.
If you have a shell alias defined for the python interpreter, it will override the python chosen for your virtualenv. For example:
user#x790:~/temp$ alias python=/usr/bin/python
user#x790:~/temp$ python --version
Python 2.7.4
user#x790:~/temp$ virtualenv --python=/usr/bin/python3 foo
Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in foo/bin/python3
Also creating executable in foo/bin/python
Installing distribute.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................done.
Installing pip................done.
user#x790:~/temp$ . foo/bin/activate
(foo)user#x790:~/temp$ python --version
Python 2.7.4
Note that the python version reported was 2.7.4, even though python3 was selected for the virtualenv. Using the env command circumvents the alias:
(foo)user#x790:~/temp$ env python --version
Python 3.3.1
Lastly, you can get around this issue by either temporarily disabling the python alias for a single command or permanently undefining it:
(foo)user#x790:~/temp$ \python --version
Python 3.3.1
(foo)user#x790:~/temp$ unalias python
(foo)user#x790:~/temp$ python --version
Python 3.3.1

datastax opscenter installation failed with 'no such option: --post-install' error

Background:
I have a 3 node cassandra (1.2.5) cluster and I am trying to install datastax on one of the nodes. I am following instructions from: http://www.datastax.com/docs/opscenter/install/install_deb
I have following already installed:
java -version = 1.6.0_24
python -V = 2.6.6
openssl version = 0.9.8g 19 Oct 2007
Issue:
When I run 'sudo apt-get install opscenter-free', the installation starts but errors out with:
update-python-modules: error: no such option: --post-install
dpkg: error processing opscenter-free (--configure):
subprocess post-installation script returned error exit status 2
Possible root cause:
By searching for error I could gather it looks like python issue.
I ran ls to see where python resides, here some results:
ls /usr/local/bin = python python2.6 python2.7
ls /usr/bin/ = python python2.5
As specified before if I run 'python -V' result is 2.6.6.
I don't understand how to make my opscenter installer to look at the appropriate version?
or how to understand which python it is referring to?
This is most likely an issue with the following from the opscenter-free package:
# cause any deferred python module compilation (like for telephus) to be done
# now, before the initscript starts
if which update-python-modules >/dev/null 2>&1; then
update-python-modules --post-install
fi
update-python-modules comes with the python-support package. It looks like the binary is available, but whatever version the install process is finding doesn't recognize the --post-install option.
If which update-python-modules points to an older (<= 2.5) or newer (3.0+) version of the script, you can try removing whatever package is including that, or updating the python-support package.

Categories