Python OSX $ which Python gives /Library/Frameworks/Python.framework/Versions/2.7/bin/python

前端 未结 4 555
春和景丽
春和景丽 2021-01-12 06:02

Hello I\'m trying to run twisted along with python but python cannot find twisted.

I did run $pip install twisted

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-12 06:36

    By the path your giving for OS X python I'm guessing your a rev-or-so old on your OS X (leopard?) so I can't directly compare with my machine.

    But, adding packages to the base OS X install is always a touchy thing, one check I would recommend is the permissions on any packages you add. Do a ls -l /Library/Python/2.7/site-packages/ and make sure everything has r rights (and x rights for directories) (I.E. -rwxr-xr-x or drwxr-xr-x).

    I had a recent case where a sudo pip wouldn't set user read rights on installed packages, and I believe "No module" was the error I was getting when I tried to use them

    Because adding packages is so touchy on OS X, there are tons of guide on the net to doing hand installs of python. The first one I matched on a google is Installing / Updateing Python on OS X (use at your own risk, I personally haven't followed that guide)

    (... the 3rd part install system Brew is a very common method for people to do automated installs of python as well)

提交回复
热议问题