推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
africle
V2EX  ›  Python

mac 虚拟环境

  •  
  •   africle · Jun 28, 2018 · 3511 views
    This topic created in 3056 days ago, the information mentioned may be changed or developed.

    (env) xxx deMacBook-Pro:~ xxx$ pip install mysql-python

    -bash: /Users/xxx/workspace#/tc/bin/pip: /Users/xxx/workspace#/tc/bin/python2.7: bad interpreter: Permission denied

    mac 只有我一个用户,在我创建的虚拟环境中没有权限,$ pip 也是这个提示,这是怎么回事呢?

    8 replies  •  2018-06-29 11:57:48 +08:00
    Geekgogo
    Geekgogo
    Jun 28, 2018
    1
    在命令前加上 sudo 试试
    africle
    africle
    OP
    Jun 28, 2018
    2
    sudo: unable to execute /Users/xxx/workspace#/tc/bin/pip: Permission denied

    还是不行。。。
    v2exe2v
    v2exe2v
    Jun 28, 2018
    3
    --user
    Geekgogo
    Geekgogo
    Jun 28, 2018
    4
    你直接在命令行输入 python 可以进入 python 的环境吗?
    africle
    africle
    OP
    Jun 28, 2018
    5
    @v2exe2v 不行
    africle
    africle
    OP
    Jun 28, 2018
    6
    @Geekgogo 可以进去的
    liyli
    liyli
    Jun 28, 2018
    7
    是路径的问题吗?看一下这个 https://blog.csdn.net/fandroid/article/details/45768501

    「已经在用户个人环境中配置好了 python,但 pip 还是默认去找 root 目录中的环境,是由于 pip 文件的第一句话指定了环境路径,那么只需要将 /dawnfs/users/me/local/bin/pip 中的第一行换成自己对应的 python 环境变量路径即可。」
    myid
    myid
    Jun 29, 2018
    8
    试试这个:

    python -m pip install mysql-python
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2184 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 152ms · UTC 14:22 · PVG 22:22 · LAX 06:22 · JFK 09:22
    ♥ Do have faith in what you're doing.