Unable to do heroku's Python tutorial within D

2019-04-30 23:42发布

EDIT2: OK this is weird. (I can't answer my own question, so I just put it as another edit to the question. I think it has something to do with the fact that I tried to do this installation within a Dropbox-synced directory. I got this to work on my Desktop. Can anyone explain why this is the case?

Original question:

I'm trying to do Heroku's Python setup tutorial (http://devcenter.heroku.com/articles/python), on my Mac OS X (Lion), but I get caught up with the step of creating a virtualenv.

So what I did was this in the command line (not using sudo caused permissions error):

sudo pip install virtualenv

But then, when I do "virtualenv venv --distribute" (I also tried with sudo), I get the following error:

New python executable in venv/bin/python
Installing distribute..............................................................................................................................................................................................................................................................................................done.
Installing pip...
  Error [Errno 2] No such file or directory while executing command /Users/AndyFang/Drop...env/bin/easy_install /Library/Python/2.7/...pport/pip-1.1.tar.gz
...Installing pip...done.
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 8, in <module>
    load_entry_point('virtualenv==1.7.1.2', 'console_scripts', 'virtualenv')()
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 928, in main
    never_download=options.never_download)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1042, in create_environment
    install_pip(py_executable, search_dirs=search_dirs, never_download=never_download)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 640, in install_pip
    filter_stdout=_filter_setup)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 966, in call_subprocess
    cwd=cwd, env=env)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Not really sure what to do. It seemed like I didn't have easy_install on my Mac, but I do have it... I'm not sure what the deal is?

EDIT: I also just tried installing virtualenv with easy_install, but I get the exact same error.

2条回答
劳资没心,怎么记你
2楼-- · 2019-05-01 00:16

If your problem is the same as mine, then it's because there's a space somewhere in the path to your Dropbox-synced folder.

查看更多
我命由我不由天
3楼-- · 2019-05-01 00:17

Virtualenvs aren't portable, so you can't keep them synced across multiple machines if the paths don't match up.

In general, it's a bad idea :)

查看更多
登录 后发表回答