V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2018-06-28 13:19:17 +08:00 · 2067 次点击
    这是一个创建于 2100 天前的主题,其中的信息可能已经有所发展或是发生改变。

    (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 条回复    2018-06-29 11:57:48 +08:00
    Geekgogo
        1
    Geekgogo  
       2018-06-28 13:42:33 +08:00
    在命令前加上 sudo 试试
    africle
        2
    africle  
    OP
       2018-06-28 13:45:05 +08:00
    sudo: unable to execute /Users/xxx/workspace#/tc/bin/pip: Permission denied

    还是不行。。。
    v2exe2v
        3
    v2exe2v  
       2018-06-28 13:47:22 +08:00
    --user
    Geekgogo
        4
    Geekgogo  
       2018-06-28 13:56:54 +08:00
    你直接在命令行输入 python 可以进入 python 的环境吗?
    africle
        5
    africle  
    OP
       2018-06-28 14:01:15 +08:00
    @v2exe2v 不行
    africle
        6
    africle  
    OP
       2018-06-28 14:01:38 +08:00
    @Geekgogo 可以进去的
    liyli
        7
    liyli  
       2018-06-28 14:02:41 +08:00
    是路径的问题吗?看一下这个 https://blog.csdn.net/fandroid/article/details/45768501

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

    python -m pip install mysql-python
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3065 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 12:50 · PVG 20:50 · LAX 05:50 · JFK 08:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.