小编Dou*_*eld的帖子

如何使'pip install'不卸载其他版本?

我在HPC上管理多个模块,并希望使用pip为工具安装一些要求.

我不会使用virtualenv,因为它们与我们的模块系统不兼容.我想安装模块本地版本的软件包,并PYTHONPATH在加载模块时正确设置,当我正在安装的软件包也没有安装在默认的python环境中时,这个工作正常.

我不想做的是在安装模块本地版本时卸载默认的python版本的软件包.

例如,一个包需要numpy==1.6,并且我使用的python安装的默认版本是1.8.0.当我

pip install --install-option="--prefix=$RE_PYTHON" numpy==1.6
Run Code Online (Sandbox Code Playgroud)

哪里RE_PYTHON指向模块本地site-packages目录的顶部,numpy==1.6安装正常,然后pip继续并1.8.0从我正在使用的python树开始卸载(为什么它想要卸载更新版本超出我但我想要即使我正在进行例如本地安装,也要避免这种情况numpy==1.10.1.

如何防止pip这样做?这真的很烦人,我找不到一个不涉及virtualenv的解决方案.

python pip

9
推荐指数
1
解决办法
3557
查看次数

Most 'functional' way to sum pairs of elements from a vector using C++17 or later?

I'd like some suggestions for the most terse and 'functional' way to gather pairs of successive elements from a vector (1st and 2nd, 3rd and 4th, etc.) using modern C++. Assume the vector is of arbitrary but even length. For the examples I'm pulling together, I'm summing the elements of each pair but that's not the main problem. I should add I'll use STL only, no Boost.

In Python I can zip them into 2-tuples via an iterator with

s …
Run Code Online (Sandbox Code Playgroud)

c++ c++17

5
推荐指数
1
解决办法
152
查看次数

标签 统计

c++ ×1

c++17 ×1

pip ×1

python ×1