设置配置文件和运行cod的问题

2024-05-26 22:56:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我对linux相当陌生,正在尝试运行一些代码。在尝试了几天没有成功之后,我希望有人能帮助我。我的Linux版本是

说明:Ubuntu 16.04.1 LTS版本:16.04代号:xenial 代码可以在这里找到:https://bitbucket.org/dsign/gecmi/wiki/Home

我的问题在于修改配置文件:site_配置.py开发者说我应该:

请检查此文件并对其进行编辑,使其与您的生成环境、要编译的目标以及要将它们安装到的位置相匹配。 首先,我尝试通过apt-get安装boost、itbb、scons和numpy/scipy库

sudo apt-get install libboost-dev
sudo apt-get install scons
sudo apt-get install python-scipy
sudo apt-get install python-numpy
sudo apt-get install libtbb-dev

我不确定这些是否是正确的版本,但这是我研究了一点后发现的。你知道吗

下一步是调整配置文件中的条目,但我发现很难(实际上我不太清楚)在安装上述库之后找出所有这些目录的位置,或者如何分别调整此配置文件:

# Use 'release' for speed, 'debug' for debugging.
COMPILE_MODE='release'
# Use one or both of the following words: 'standalone' for 
# building the standalone executable, 'python' for building
# the python module
COMPILE_TARGETS='standalone python'
# Where the boost library is installed. I expect an 'include'
# and a 'lib' dir below.
BOOST_ROOT='/opt/boost_1_47_0/'
# The prefix of the python installation. This is used for deducing
# include directories and lib path of python
PYTHON_PREFIX="/usr/"
# The python's version. Used for deducing include directories and 
# library name of python.
PYTHON_VERSION ="2.7"
# Where the Intel threading building blocks is installed. I expect
# and 'include' and a 'lib' directory below this one.
TBB_PREFIX="/home/alcides/programming/projects/sci_python/prx"
# The executable for the c++ compiler to use. 
COMPILER_NAME="g++-4.6"
# The place where numpy is installed. I expect the directories 
# 'core/include' and 'numarray/include' below.
NUMPY_PREFIX="/usr/local/lib/python2.7/dist-packages/numpy/"

# Where you sould like the standalone program to be installed
GECMI_PROGRAM_INSTALL_AT='/usr/local/bin'
# Where you would like the shared library to be installed. This
# library is used by both the python module and the standalone 
# program.
GECMI_LIB_INSTALL_AT='/usr/local/lib'
# Where would you like to have the module installed, for the 
# target 'InstallPythonModule'. A dll file called gecmi.{dllext}
# is installed there. 
PYTHON_MODULE_INSTALL_AT='/usr/lib/python2.7/dist-packages'

作者的提示指向修改LD\u LIBRARY\u PATH变量,但也没有给我多少帮助:

如果未正确安装依赖项,则可以在加载共享库时获取此类错误消息。在这种情况下,您可能需要摆弄命令locate和环境变量LD\u LIBRARY\u PATH,或者您选择的操作系统中的等效项。 我试着使用whereis和locate,但不确定是否有效。例如,当我使用whereis boost或locate boost时,我发现了很多目录,但是没有像boost/include或boost/lib这样的目录,这似乎是配置文件所期望的。对于numpy,没有numarray/include文件夹asf。你知道吗

所以基本上,我想知道一个linux超级用户如何找到所有必要的路径和目录,并找出如何运行这些代码(或者你们中的一些人是否可以运行这些代码)。我也很感谢你提供更多关于如何更熟悉解决这些问题的信息/指导/建议。你知道吗

谢谢!你知道吗


Tags: installinstalledandthenumpyforgetinclude
1条回答
网友
1楼 · 发布于 2024-05-26 22:56:04

在终端中写入以下命令

sudo apt-get update
sudo apt-get -y upgrade

python3 -V (out put is Python 3.5.2 may be or other version..)

sudo apt-get install -y python3-pip

pip3 install package_name

sudo apt-get install build-essential libssl-dev libffi-dev python-dev


sudo apt-get install -y python3-venv

有关更多帮助,请参阅这些网站

https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-ubuntu-16-04

相关问题 更多 >

    热门问题