Python 2.7 无法在/usr/lib/Python2.7中创建站点包,它显示;“不允许操作”;

Python 2.7 无法在/usr/lib/Python2.7中创建站点包,它显示;“不允许操作”;,python-2.7,thrift,macos-mojave,Python 2.7,Thrift,Macos Mojave,我试图在我的系统(macOs 10.14.5)上安装thrift(0.11.0)。为此我下载并提取了tar文件。然后我运行了以下命令: ./bootstrap.sh ./configure make make install 但是makeinstall抛出了以下错误: error: could not create '/usr/lib/python2.7/site-packages': Operation not permitted 然后,我还尝试在/usr/lib/python2.7内手动

我试图在我的系统(macOs 10.14.5)上安装thrift(0.11.0)。为此我下载并提取了tar文件。然后我运行了以下命令:

./bootstrap.sh
./configure
make
make install
但是makeinstall抛出了以下错误:

error: could not create '/usr/lib/python2.7/site-packages': Operation not permitted
然后,我还尝试在/usr/lib/python2.7内手动创建站点包,但错误消息仍然相同。
我在运行make install时也尝试过sudo,但没有多大帮助。

我在Mac OS上安装thrift时也遇到了同样的问题

我找到了一个在Mac OS上安装thrift的单独指南,我尝试了一下,最后它成功了:

1-使用从untar下载boost库编译

./bootstrap.sh
sudo ./b2 threading=multi address-model=64 variant=release stage install
./configure --prefix=/usr/local 
make
sudo make install
./configure --prefix=/usr/local/ --with-boost=/usr/local --with-libevent=/usr/local
2-下载、卸载和编译

./bootstrap.sh
sudo ./b2 threading=multi address-model=64 variant=release stage install
./configure --prefix=/usr/local 
make
sudo make install
./configure --prefix=/usr/local/ --with-boost=/usr/local --with-libevent=/usr/local
3-下载最新版本的,untar并使用

./bootstrap.sh
sudo ./b2 threading=multi address-model=64 variant=release stage install
./configure --prefix=/usr/local 
make
sudo make install
./configure --prefix=/usr/local/ --with-boost=/usr/local --with-libevent=/usr/local
试试看,让我知道你的结果


参考:

1.打开thrift的子文件夹lib/py/并按如下方式修改生成文件:

PY_前缀=/usr

改为

PY_前缀=/Users/amy/python


2.sudo make install

考虑一下在邮件列表上问这个问题。我也面临同样的问题,你找到什么了吗?