Trying to set up a build environment on my macbook pro 2015 according to the instructions. I successfully reach this step of the process:
brew tap ardupilot/homebrew-px4
and on execute I get this output:
2015mattmacbookproW:~ mholmes$ brew tap ardupilot/homebrew-px4
==> Tapping ardupilot/px4
Cloning into ‘/usr/local/Homebrew/Library/Taps/ardupilot/homebrew-px4’…
remote: Enumerating objects: 242, done.
remote: Total 242 (delta 0), reused 0 (delta 0), pack-reused 242
Receiving objects: 100% (242/242), 305.35 KiB | 694.00 KiB/s, done.
Resolving deltas: 100% (137/137), done.
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/ardupilot/homebrew-px4/px4-dev.rb
px4-dev: Unsupported special dependency :java
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/ardupilot/homebrew-px4/kconfig-frontends.rb
kconfig-frontends: Calling sha256 "digest" => :tag in a bottle block is disabled! Use brew style --fix on the formula to update the style or use sha256 tag: "digest" instead.
Please report this issue to the ardupilot/px4 tap (not Homebrew/brew or Homebrew/core), or even better, submit a PR to fix it:
/usr/local/Homebrew/Library/Taps/ardupilot/homebrew-px4/kconfig-frontends.rb:18
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/ardupilot/homebrew-px4/px4-sim.rb
px4-sim: Unsupported special dependency :x11
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/ardupilot/homebrew-px4/fastrtps.rb
fastrtps: Unsupported special dependency :java
Error: Cannot tap ardupilot/px4: invalid syntax in tap!
the first error is an “invalid formula” due to “unsupported special dependency :java”
Do you think you could try out the modified script? You’d need to download the branch and then run the script on your mac. If that’s too difficult tell me and we should get it merged to latest in the next week or so I hope.
Thank you for the help, I got all the prereqs installed.
There were some hiccups in the script, though it could just be the way my mac’s setup:
When answering yes to pyenv, the script exits after installing pyenv
Pip commands kept returning the error below. This was resolved by running ‘pip install typing’ and setting up an alias pip=‘pip3’
pip error:
+ pip install --upgrade pip
Traceback (most recent call last):
File "/usr/local/bin/pip", line 11, in <module>
load_entry_point('pip==21.1.2', 'console_scripts', 'pip')()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2843, in load_entry_point
return ep.load()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2434, in load
return self.resolve()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2440, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/Library/Python/2.7/site-packages/pip-21.1.2-py2.7.egg/pip/__init__.py", line 1, in <module>
from typing import List, Optional
ImportError: No module named typing
I answered yes to pyenv and it continued onward fine
I received the same error ‘No module named typing’. I ran alias pip='pip3' and then pip install typing (just aping @brysonwu, not because I know what I’m doing) and it seemed to install the typing module (with a warning about pip version not being the latest).
I then re-ran the script again in it’s entirety and it completed successfully without errors.
I just finished that and haven’t tried moving forward with getting the rest of the the build environment set up, but I wanted to report the results from my script run. Thanks for the hard work guys
I spoke too soon, the script did not complete successfully after I re-ran it; it failed at they python step. Below is an excerpt from the last portion of the output from re-running the script (after running the pip install typing command):
Installing Python-3.9.4...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
ERROR: invalid Python executable: /Users/mholmes/.pyenv/versions/3.9.4/bin/python3.9
The python-build could not find proper executable of Python after successful build.
Please open an issue for future improvements.
https://github.com/pyenv/pyenv/issues
BUILD FAILED (OS X 11.4 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/gc/z_j7v_gn4fv8mtqyvhh35rzm0000gn/T/python-build.20210627100455.44241
Results logged to /var/folders/gc/z_j7v_gn4fv8mtqyvhh35rzm0000gn/T/python-build.20210627100455.44241.log
Last 10 log lines:
case upgrade in \
upgrade) ensurepip="--upgrade" ;; \
install|*) ensurepip="" ;; \
esac; \
DYLD_FRAMEWORK_PATH=/var/folders/gc/z_j7v_gn4fv8mtqyvhh35rzm0000gn/T/python-build.20210627100455.44241/Python-3.9.4 ./python.exe -E -m ensurepip \
$ensurepip --root=/ ; \
fi
Looking in links: /var/folders/gc/z_j7v_gn4fv8mtqyvhh35rzm0000gn/T/tmpzzzd_mg3
Requirement already up-to-date: setuptools in /Users/mholmes/.pyenv/versions/3.9.4/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (49.2.1)
Requirement already up-to-date: pip in /Users/mholmes/.pyenv/versions/3.9.4/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (20.2.3)
Any suggestions on how to proceed from here?
thanks
Hi @brysonwu@CBwintertime seems like pyenv installation is failing for you. Can you share the full log pyenv failed with. The additional step you mentioned should not be required if pyenv install succeeded.
forgot to mention, also clear lines added in ~/.bash_profile and ~/.zshrc . Not absolutely necessary, just cleaner.
I have fixed an issue with detection of SHELL type , please verify. I have forced pushed the code, so to fetch do git fetchgit checkout pr-install-prereq-macosgit reset --hard <remote>/pr-install-prereq-macos
and the version of pip isn’t compatible with the old python. So how do I make it use the correct version of python? this multiple python version control stuff is beyond me
@CBwintertime so the issue is basically after pyenv install you are still ending up with legacy installed pip being used. The pyenv is basically a way to easily install and manage various versions of python python version != pyenv version.
Also I mentioned that you need to remove your previous pyenv installation rm -rf ~/.pyenv which it seems you missed. Can you do that so pyenv can be installed and configured again.
I have forced pushed again, reverted a change, so pull accordingly.
Also can you do echo $SHELL and check that it matches the shell you are using (you can check that in your Terminal preferences)
I had indeed removed pyenv before running the script. At least I think it is successfully being removed. I went through the process again, terminal activity shown below, including the pyenv removal and shell identification. I’m not sure what you mean by checking to make sure the echo $SHELL matches the shell I’m using. Doesn’t echo $SHELL return the shell that I’m using? My preferences are set to use /bin/bash and the terminal window title has the -bash, so all of that together makes me think I’ve got a bash shell…
The script makes it to the same place as previously.
2015mattmacbookproW:environment_install mholmes$ rm -rf ~/.pyenv
2015mattmacbookproW:environment_install mholmes$ which .pyenv
2015mattmacbookproW:environment_install mholmes$ echo $SHELL
/bin/bash
2015mattmacbookproW:environment_install mholmes$ ./prereqsscript_20210629a.sh
---------- ./prereqsscript_20210629a.sh start ----------
+ '[' 501 == 0 ']'
+ [[ /bin/bash == *\z\s\h* ]]
+ [[ /bin/bash == *\b\a\s\h* ]]
+ AP_COMPLETION_SCR=completion.bash
+ SHELL_LOGIN=.bash_profile
+ OPT=/opt
+ ARDUPILOT_TOOLS=Tools/autotest
+ ASSUME_YES=false
+ sep='##############################################'
+ OPTIND=1
+ getopts y opt
+ echo 'Checking homebrew...'
Checking homebrew...
++ which -s brew
+ echo 'Homebrew installed'
Homebrew installed
+ echo 'Checking CLI Tools installed...'
Checking CLI Tools installed...
++ xcode-select --install
+ ERROR='xcode-select: error: command line tools are already installed, use "Software Update" to install updates'
+ [[ xcode-select: error: command line tools are already installed, use "Software Update" to install updates != *\c\o\m\m\a\n\d\ \l\i\n\e\ \t\o\o\l\s\ \a\r\e\ \a\l\r\e\a\d\y\ \i\n\s\t\a\l\l\e\d* ]]
+ brew update
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
jrsonnet
==> Updated Formulae
aws-cdk fastlane glooctl gpg-tui newrelic-cli python@3.8 rmw truffle
==> New Casks
maestral portx touchosc
==> Updated Casks
amazon-music gather miniforge retroarch telegram-desktop
anka-build-cloud-controller-and-registry ibackup-viewer netron retroarch-metal tencent-lemon
anka-build-cloud-registry logseq psychopy sejda-pdf touchosc-bridge
bisq macdive qlc-plus skim touchosc-editor
dosbox meteorologist qutebrowser standard-notes whatsapp
+ brew install gawk curl coreutils wget
Warning: gawk 5.1.0 is already installed and up-to-date.
To reinstall 5.1.0, run:
brew reinstall gawk
Warning: curl 7.77.0 is already installed and up-to-date.
To reinstall 7.77.0, run:
brew reinstall curl
Warning: coreutils 8.32 is already installed and up-to-date.
To reinstall 8.32, run:
brew reinstall coreutils
Warning: wget 1.21.1 is already installed and up-to-date.
To reinstall 1.21.1, run:
brew reinstall wget
+ PIP=pip
+ maybe_prompt_user 'Install python using pyenv [N/y]?'
+ false
+ read -p 'Install python using pyenv [N/y]?'
Install python using pyenv [N/y]?y
+ [[ y =~ ^[Yy]$ ]]
+ return 0
+ echo 'Checking pyenv...'
Checking pyenv...
++ which -s pyenv
+ echo 'pyenv installed'
pyenv installed
+ env PYTHON_CONFIGURE_OPTS=--enable-framework pyenv install 3.9.4
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.4.tar.xz...
-> https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
Installing Python-3.9.4...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
Installed Python-3.9.4 to /Users/mholmes/.pyenv/versions/3.9.4
+ pyenv global 3.9.4
+ [[ -z '' ]]
+ maybe_prompt_user 'Install ArduPilot STM32 toolchain [N/y]?'
+ false
+ read -p 'Install ArduPilot STM32 toolchain [N/y]?'
Install ArduPilot STM32 toolchain [N/y]?y
+ [[ y =~ ^[Yy]$ ]]
+ return 0
+ DO_AP_STM_ENV=1
+ echo 'Checking ccache...'
Checking ccache...
++ which -s ccache
++ which ccache
+ CCACHE_PATH=/usr/local/bin/ccache
+ [[ 1 -eq 1 ]]
+ install_arm_none_eabi_toolchain
+ ARM_ROOT=gcc-arm-none-eabi-6-2017-q2-update
+ ARM_TARBALL=gcc-arm-none-eabi-6-2017-q2-update-mac.tar.bz2
+ ARM_TARBALL_URL=https://firmware.ardupilot.org/Tools/STM32-tools/gcc-arm-none-eabi-6-2017-q2-update-mac.tar.bz2
+ '[' '!' -d /opt/gcc-arm-none-eabi-6-2017-q2-update ']'
+ echo 'Registering STM32 Toolchain for ccache'
Registering STM32 Toolchain for ccache
+ sudo ln -s -f /usr/local/bin/ccache /usr/local/opt/ccache/libexec/arm-none-eabi-g++
Password:
+ sudo ln -s -f /usr/local/bin/ccache /usr/local/opt/ccache/libexec/arm-none-eabi-gcc
+ echo 'Done!'
Done!
+ PYTHON_PKGS='future lxml pymavlink MAVProxy pexpect geocoder flake8'
+ [[ '' -ne 1 ]]
+ PYTHON_PKGS='future lxml pymavlink MAVProxy pexpect geocoder flake8 intelhex gnureadline'
+ [[ '' -ne 1 ]]
+ PYTHON_PKGS='future lxml pymavlink MAVProxy pexpect geocoder flake8 intelhex gnureadline wxPython billiard'
+ pip install --upgrade pip
Traceback (most recent call last):
File "/usr/local/bin/pip", line 11, in <module>
load_entry_point('pip==21.1.2', 'console_scripts', 'pip')()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2843, in load_entry_point
return ep.load()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2434, in load
return self.resolve()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2440, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/Library/Python/2.7/site-packages/pip-21.1.2-py2.7.egg/pip/__init__.py", line 1, in <module>
from typing import List, Optional
ImportError: No module named typing
2015mattmacbookproW:environment_install mholmes$
@CBwintertime can you remove ~/.pyenv , restart the terminal and then share the output of which pyenv it should be empty. Something bizarre is going on, I don’t see the installation process of pyenv in your log.