V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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 · 2970 views
    This topic created in 2861 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
        1
    Geekgogo  
       Jun 28, 2018
    在命令前加上 sudo 试试
    africle
        2
    africle  
    OP
       Jun 28, 2018
    sudo: unable to execute /Users/xxx/workspace#/tc/bin/pip: Permission denied

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

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

    python -m pip install mysql-python
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5608 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 07:27 · PVG 15:27 · LAX 00:27 · JFK 03:27
    ♥ Do have faith in what you're doing.