簡體   English   中英

無法安裝 python 包“toml”

[英]Unable to install python package “toml”

我正在關注本教程以連接 ROS 和涼亭。

當我跑

制作 posix_sitl_default 涼亭

[  0%] Built target git_driverframework
[  0%] Built target git_gps_devices
[  0%] Built target uorb_headers
[  2%] Built target df_driver_framework
[  3%] Built target git_mavlink2
[  3%] Built target git_mavlink
[  3%] Built target git_ecl
[  3%] Built target mixer_gen_legacy
[  4%] Generating mixer_multirotor_6dof.generated.h
[  4%] Generating mixer_multirotor_normalized.generated.h
[  4%] Generating mixer_multirotor.generated.h
[  5%] Built target ver_gen
('python import error: ', ImportError('No module named toml',))
('python import error: ', ImportError('No module named toml',))

Required python packages not installed.

On a GNU/Linux or MacOS system please run:
  sudo pip install numpy toml

On Windows please run:
  easy_install numpy toml

Required python packages not installed.

On a GNU/Linux or MacOS system please run:
  sudo pip install numpy toml

On Windows please run:
  easy_install numpy toml

我使用的是 Ubuntu 16.04,所以我使用 sudo pip install numpy toml 但是:

The directory '/home/nando/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/nando/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: numpy in /opt/anaconda/lib/python2.7/site-packages
Requirement already satisfied: toml in /opt/anaconda/lib/python2.7/site-packages

顯然我已經滿足了要求,但是當我運行第一個命令時,我一直收到相同的錯誤消息。 我怎樣才能解決這個問題?

顯然問題是我有 python 2 和 3,我在 3 中安裝了 toml。運行:

sudo -H pip2 install toml

為我解決了這個問題

我通過使用 pip3 安裝 toml 解決了它

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM