简体   繁体   中英

Installing python3.6 on ubuntu16.04

I am trying to install python3.6 on ubuntu16.04 LTS but having some issues. I tried adding deadsnakes/ppa and installing it but no success. It is probably because there is no python3.6 for xenial installation anymore?

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

I also tried building the source. The following commands run fine.

root@c2d64b30b259:~/Python-3.6.0# ./configure
root@c2d64b30b259:~/Python-3.6.0# make
root@c2d64b30b259:~/Python-3.6.0# make install 

However, when running some python scripts which import modules, I get hit with the following errors.

  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__'

Any suggestions would be appreciated. Please note I am running ubuntu16.04 LTS inside a docker environment.

Seems like the issue was with my building the source code that I obtained online. Re-installing with the source from following link seems to resolve my issues.

https://github.com/deadsnakes/python3.6

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM