在 ubuntu16.04 上安装 python3.6
Installing python3.6 on ubuntu16.04
我正在尝试在 ubuntu16.04 LTS 上安装 python3.6,但遇到了一些问题。我尝试添加 deadsnakes/ppa 并安装它但没有成功。可能是因为xenial安装没有python3.6了?
root@c2d64b30b259:~# apt-add-repository ppa:deadsnakes/ppa
root@c2d64b30b259:~# apt update
root@c2d64b30b259:~# apt install python3.6
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3.6
E: Couldn't find any package by glob 'python3.6'
E: Couldn't find any package by regex 'python3.6'
https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa/+packages
我也尝试构建源代码。以下命令 运行 没问题。
root@c2d64b30b259:~/Python-3.6.0# ./configure
root@c2d64b30b259:~/Python-3.6.0# make
root@c2d64b30b259:~/Python-3.6.0# make install
然而,当 运行 宁一些 python 导入模块的脚本时,我遇到了以下错误。
import pandas as pd
File "/usr/local/lib/python3.6/site-packages/pandas/__init__.py", line 55, in <module>
from pandas.core.api import (
File "/usr/local/lib/python3.6/site-packages/pandas/core/api.py", line 24, in <module>
from pandas.core.groupby import Grouper, NamedAgg
File "/usr/local/lib/python3.6/site-packages/pandas/core/groupby/__init__.py", line 1, in <module>
from pandas.core.groupby.generic import ( # noqa: F401
File "/usr/local/lib/python3.6/site-packages/pandas/core/groupby/generic.py", line 44, in <module>
from pandas.core.frame import DataFrame
File "/usr/local/lib/python3.6/site-packages/pandas/core/frame.py", line 115, in <module>
from pandas.core.series import Series
File "/usr/local/lib/python3.6/site-packages/pandas/core/series.py", line 84, in <module>
import pandas.plotting
File "/usr/local/lib/python3.6/site-packages/pandas/plotting/__init__.py", line 59, in <module>
from pandas.plotting._core import (
File "/usr/local/lib/python3.6/site-packages/pandas/plotting/_core.py", line 17, in <module>
import pandas.plotting._matplotlib # noqa
File "/usr/local/lib/python3.6/site-packages/pandas/plotting/_matplotlib/__init__.py", line 3, in <module>
from pandas.plotting._matplotlib.boxplot import (
File "/usr/local/lib/python3.6/site-packages/pandas/plotting/_matplotlib/boxplot.py", line 4, in <module>
from matplotlib.artist import setp
File "/usr/local/lib/python3.6/site-packages/matplotlib/__init__.py", line 107, in <module>
from . import cbook, rcsetup
File "/usr/local/lib/python3.6/site-packages/matplotlib/rcsetup.py", line 28, in <module>
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "/usr/local/lib/python3.6/site-packages/matplotlib/fontconfig_pattern.py", line 15, in <module>
from pyparsing import (Literal, ZeroOrMore, Optional, Regex, StringEnd,
File "/usr/local/lib/python3.6/site-packages/pyparsing/__init__.py", line 130, in <module>
__version__ = __version_info__.__version__
AttributeError: 'version_info' object has no attribute '__version__'
如有任何建议,我们将不胜感激。请注意,我在 docker 环境中 运行ning ubuntu16.04 LTS。
问题似乎出在我构建从网上获得的源代码上。 Re-installing 与来源 link 似乎解决了我的问题。
我正在尝试在 ubuntu16.04 LTS 上安装 python3.6,但遇到了一些问题。我尝试添加 deadsnakes/ppa 并安装它但没有成功。可能是因为xenial安装没有python3.6了?
root@c2d64b30b259:~# apt-add-repository ppa:deadsnakes/ppa
root@c2d64b30b259:~# apt update
root@c2d64b30b259:~# apt install python3.6
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3.6
E: Couldn't find any package by glob 'python3.6'
E: Couldn't find any package by regex 'python3.6'
https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa/+packages
我也尝试构建源代码。以下命令 运行 没问题。
root@c2d64b30b259:~/Python-3.6.0# ./configure
root@c2d64b30b259:~/Python-3.6.0# make
root@c2d64b30b259:~/Python-3.6.0# make install
然而,当 运行 宁一些 python 导入模块的脚本时,我遇到了以下错误。
import pandas as pd
File "/usr/local/lib/python3.6/site-packages/pandas/__init__.py", line 55, in <module>
from pandas.core.api import (
File "/usr/local/lib/python3.6/site-packages/pandas/core/api.py", line 24, in <module>
from pandas.core.groupby import Grouper, NamedAgg
File "/usr/local/lib/python3.6/site-packages/pandas/core/groupby/__init__.py", line 1, in <module>
from pandas.core.groupby.generic import ( # noqa: F401
File "/usr/local/lib/python3.6/site-packages/pandas/core/groupby/generic.py", line 44, in <module>
from pandas.core.frame import DataFrame
File "/usr/local/lib/python3.6/site-packages/pandas/core/frame.py", line 115, in <module>
from pandas.core.series import Series
File "/usr/local/lib/python3.6/site-packages/pandas/core/series.py", line 84, in <module>
import pandas.plotting
File "/usr/local/lib/python3.6/site-packages/pandas/plotting/__init__.py", line 59, in <module>
from pandas.plotting._core import (
File "/usr/local/lib/python3.6/site-packages/pandas/plotting/_core.py", line 17, in <module>
import pandas.plotting._matplotlib # noqa
File "/usr/local/lib/python3.6/site-packages/pandas/plotting/_matplotlib/__init__.py", line 3, in <module>
from pandas.plotting._matplotlib.boxplot import (
File "/usr/local/lib/python3.6/site-packages/pandas/plotting/_matplotlib/boxplot.py", line 4, in <module>
from matplotlib.artist import setp
File "/usr/local/lib/python3.6/site-packages/matplotlib/__init__.py", line 107, in <module>
from . import cbook, rcsetup
File "/usr/local/lib/python3.6/site-packages/matplotlib/rcsetup.py", line 28, in <module>
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "/usr/local/lib/python3.6/site-packages/matplotlib/fontconfig_pattern.py", line 15, in <module>
from pyparsing import (Literal, ZeroOrMore, Optional, Regex, StringEnd,
File "/usr/local/lib/python3.6/site-packages/pyparsing/__init__.py", line 130, in <module>
__version__ = __version_info__.__version__
AttributeError: 'version_info' object has no attribute '__version__'
如有任何建议,我们将不胜感激。请注意,我在 docker 环境中 运行ning ubuntu16.04 LTS。
问题似乎出在我构建从网上获得的源代码上。 Re-installing 与来源 link 似乎解决了我的问题。