最新消息:20210917 已从crifan.com换到crifan.org

【已解决】Mac中用pyenv安装最新版Python 3.9.4

Mac crifan 399浏览 0评论
折腾:
【未解决】Mac中pipenv安装报错:Could not find a version that matches pandas
期间,去Mac中,用pyenv安装最新版Python
pyenv list python versions
Python Versions Management With pyenv (switowski.com)
Managing Multiple Python Versions With pyenv – Real Python
pyenv install --list

 pyenv install --list | grep " 3\.[789]" 
  3.7.0
  3.7-dev
  3.7.1
  3.7.2
  3.7.3
  3.7.4
  3.7.5
  3.7.6
  3.7.7
  3.7.8
  3.7.9
  3.7.10
  3.8.0
  3.8-dev
  3.8.1
  3.8.2
  3.8.3
  3.8.4
  3.8.5
  3.8.6
  3.8.7
  3.8.8
  3.8.9
  3.9.0
  3.9-dev
  3.9.1
  3.9.2
  3.9.3
  3.9.4
 crifan@licrifandeMacBook-Pro  ~/dev/dev_root/projects/团队业绩统计/TeamSaleStatistic  
去安装最新的:
3.9.4
 python install 3.9.4/Users/crifan/.pyenv/versions/3.7.3/bin/python: can't open file 'install': [Errno 2] No such file or directory
然后去看看 加上-v
pyenv install -v 3.9.4
期间一堆log
其中有编译的
。。
clang -c -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include   -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include   -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal  -I. -I./Include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/crifan/.pyenv/versions/3.9.4/include  -I/usr/local/opt/zlib/include -I/usr/local/opt/zlib/include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/crifan/.pyenv/versions/3.9.4/include  -I/usr/local/opt/zlib/include -I/usr/local/opt/zlib/include  -DPy_BUILD_CORE -o Python/hamt.o Python/hamt.c
clang -c -Wno-unused-result -Wsign-compare -Wunreachable-code
看来是:
用clang去编译的
加上了很多参数
比如:
  • -Wno-unused-result
    • no-unused-result
最后安装完毕了:

(cd /Users/crifan/.pyenv/versions/3.9.4/bin; ln -s pydoc3.9 pydoc3)
rm -f /Users/crifan/.pyenv/versions/3.9.4/bin/2to3
(cd /Users/crifan/.pyenv/versions/3.9.4/bin; ln -s 2to3-3.9 2to3)
if test "x" != "x" ; then \
        rm -f /Users/crifan/.pyenv/versions/3.9.4/bin/python3-32; \
        (cd /Users/crifan/.pyenv/versions/3.9.4/bin; ln -s python3.9-32 python3-32) \
fi
rm -f /Users/crifan/.pyenv/versions/3.9.4/share/man/man1/python3.1
(cd /Users/crifan/.pyenv/versions/3.9.4/share/man/man1; ln -s python3.9.1 python3.1)
if test "xupgrade" != "xno"  ; then \
        case upgrade in \
                upgrade) ensurepip="--upgrade" ;; \
                install|*) ensurepip="" ;; \
        esac; \
         ./python.exe -E -m ensurepip \
                $ensurepip --root=/ ; \
fi
Looking in links: /var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/tmpbt7xg9h7
Processing /private/var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/tmpbt7xg9h7/setuptools-49.2.1-py3-none-any.whl
Processing /private/var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/tmpbt7xg9h7/pip-20.2.3-py2.py3-none-any.whl
Installing collected packages: setuptools, pip
  WARNING: The script easy_install-3.9 is installed in '/Users/crifan/.pyenv/versions/3.9.4/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  NOTE: The current PATH contains path(s) starting with `~`, which may not be expanded by all applications.
  WARNING: The scripts pip3 and pip3.9 are installed in '/Users/crifan/.pyenv/versions/3.9.4/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  NOTE: The current PATH contains path(s) starting with `~`, which may not be expanded by all applications.
Successfully installed pip-20.2.3 setuptools-49.2.1
/var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/python-build.20210610101352.86333 ~/dev/dev_root/projects/团队业绩统计/TeamSaleStatistic
Installed Python-3.9.4 to /Users/crifan/.pyenv/versions/3.9.4


~/dev/dev_root/projects/团队业绩统计/TeamSaleStatistic
看看版本:
 crifan@licrifandeMacBook-Pro  ~/dev/dev_root/projects/团队业绩统计/TeamSaleStatistic  pyenv versions        
  system
  3.5.2
  3.6.6
* 3.7.3 (set by /Users/crifan/.pyenv/version)
  3.9.4
 crifan@licrifandeMacBook-Pro  ~/dev/dev_root/projects/团队业绩统计/TeamSaleStatistic  pyenv global 3.9.4            
 crifan@licrifandeMacBook-Pro  ~/dev/dev_root/projects/团队业绩统计/TeamSaleStatistic  pyenv local       
pyenv: no local version configured for this directory
 ✘ crifan@licrifandeMacBook-Pro  ~/dev/dev_root/projects/团队业绩统计/TeamSaleStatistic  pyenv version 
3.9.4 (set by /Users/crifan/.pyenv/version)
是我们希望的:3.9.4了
 crifan@licrifandeMacBook-Pro  ~/dev/dev_root/projects/团队业绩统计/TeamSaleStatistic  python --version    
Python 3.9.4

转载请注明:在路上 » 【已解决】Mac中用pyenv安装最新版Python 3.9.4

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
92 queries in 0.190 seconds, using 23.36MB memory