no module named tensorboard

在尝试运行Tensorboard时遇到了'no module named tensorboard'的错误。问题源于pip和python的位置不匹配。通过使用`python3 -m pip install tensorboard`安装解决了依赖问题,但之后运行Tensorboard时出现AttributeError。卸载并重新安装pathlib后,成功启动Tensorboard,但显示了一些警告和错误信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

root@104:/usr/local/lib/python3.6/dist-packages# which pip
/usr/local/bin/pip
root@104:/usr/local/lib/python3.6/dist-packages# which python
/usr/bin/python
root@104:/usr/local/lib/python3.6/dist-packages# python
Python 3.6.9 (default, Nov 25 2022, 14:10:45) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
root@104:/usr/local/lib/python3.6/dist-packages# python3
Python 3.6.9 (default, Nov 25 2022, 14:10:45) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
root@104:/usr/local/lib/python3.6/dist-packages# 

这是因为pip与python位置不一致

需要使用python3 -m pip的方式安装,

使用pip install或者pip3 install 甚至带上--force-reinstall都无效

root:/usr/local/lib/python3.6/dist-packages# python3 -m pip install tensorboard==2.9
/usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
  from cryptography.utils import int_from_bytes
Looking in indexes: http://artifact.enflame.cn/artifactory/api/pypi/pypi-remote/simple, https://pypi.ngc.nvidia.com
Collecting tensorboard==2.9
  Downloading http://artifact.enflame.cn/artifactory/api/pypi/pypi-remote/packages/packages/69/80/a3abccc4ea941c36741751206e40e619afe28652cf76f74cfa4c3e4248ba/tensorboard-2.9.0-py3-none-any.whl (5.8 MB)
     |████████████████████████████████| 5.8 MB 26.3 MB/s 
Requirement already satisfied: requests<3,>=2.21.0 in /usr/local/lib/python3.6/dist-packages (from tensorboard==2.9) (2.27.1)
Requirement already satisfied: numpy>=1.12.0 in /usr/local/lib/python3.6/dist-packages (from tensorboard==2.9) (1.19.5)
Requirement already satisfied: setuptools>=41.0.0 in /usr/local/lib/python3.6/dist-packages (from tensorboard==2.9) (59.6.0)
Requirement already satisfied: google-auth<3,>=1.6.3 in /usr/local/lib/python3.6/dist-packages (from tensorboard==2.9) (2.16.1)
Requirement already satisfied: absl-py>=0.4 in /usr/local/lib/python3.6/dist-packages (from tensorboard==2.9) (1.3.0)
Requirement already satisfied: grpcio>=1.24.3 in /usr/local/lib/python3.6/dist-packages (from tensorboard==2.9) (1.48.2)
Requirement already satisfied:

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值