Mod:Hunt Research Group/MacPorts
From ChemWiki
MacPorts
- installing MacPorts
- find installation information here link
- find general information here link
- download and follow the instructions
- macport installs in /opt/local so add to your path "export PATH=/opt/local/bin:/opt/local/sbin:$PATH"
- see information below if gcc is using mac version and not macports
- after a major OS upgrade you will need to install a new MacPorts
- using MacPorts basic commands
- you will need to run all commands as sudo
- general commands to update macports
- sudo port version
- sudo port selfupdate
- sudo port outdated
- sudo port upgrade
- find out what is installed
- sudo port installed
- sudo port select --list name
- sudo port uninstall --follow-dependents name
- sudo port uninstall name
- sudo port clean name
- find out what you could install
- sudo port installed '*name*'
- port search --name --line --glob '*name*'
- activate new install
- sudo port activate name
- sudo port deactivate name
- sudo port select --set python python37 or which ever version you want
- sudo port select --set python none removes the assignment
- in particular for python
- port search --name --line --glob 'python*'
- port installed 'python*'
- port select --list python
- port select --set python python37
- port select --set python2 python27
- problems
python versions
- the Mac (Sierra) has a preinstalled version of python in /user/local/bin
- the Mac (Mojave) has a preinstalled version of python in /user/bin
- python.org installs in /Library/Frameworks/Python.framework/Versions/3.5/bin and so on
- macports installs in /opt/local/bin
- to find out which version is being used type "which python"
- to find out the version of python used "python -V":or "python --version"
- to ensure the macports version is used in your $PATH make sure /opt/local/bin occurs before /user/bin
- sometimes other initiating files add things to your path, so key an eye on this variable
- choose in what order to search the relevant directories
for example
export PATH="/opt/local/bin:/opt/local/sbin:$PATH" export PATH=$PATH:/Users/$USER/bin [tricia@clove]/Users/tricia $ echo $PATH /opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/tricia/bin [tricia@clove]/Users/tricia $
- old notes
pip versions
- pip3 --version delivers 3.5 and not 3.7
- which pip shows /opt/local BUT pip3 shows /usr/local
- so pip3 is from the wrong installation of python
- sudo port select --set pip pip27 works BUT sudo port select --set pip3 pip37 fails!
- so force the use of python3: sudo -H python3 -m pip install .