2

This is the error I am getting

Failed to import the site module
Traceback (most recent call last):
  File "/usr/lib/python3.5/site.py", line 580, in <module>
    main()
  File "/usr/lib/python3.5/site.py", line 566, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/lib/python3.5/site.py", line 287, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/lib/python3.5/site.py", line 263, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/lib/python3.5/site.py", line 253, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/lib/python3.5/sysconfig.py", line 595, in get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python3.5/sysconfig.py", line 538, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/usr/lib/python3.5/sysconfig.py", line 410, in _init_posix
    from _sysconfigdata import build_time_vars
  File "/usr/lib/python3.5/_sysconfigdata.py", line 6, in <module>
    from _sysconfigdata_m import *
ImportError: No module named '_sysconfigdata_m'

Any thoughts? I have an anaconda distribution, and I am running this off of Jenkins on a google VM I have spinning.

When I try to run python, python3, python3.5 from the shell I get these errors.

Weirdly though I have no issues when I run python2 from the shell, it works fine....

Any thoughts?

Thanks

codebrotherone
  • 541
  • 6
  • 22
  • I'm also having this problem and I can see that you also commented on the accepted answer [on the same issue](https://stackoverflow.com/questions/21446220/linux-weird-python-output) from a while ago. Like you, my ```etc/bash.bashrc``` doesn't have ```python``` in front of the command. I tried adding ```python 3.3``` and ```python 3.5``` in front of it but neither worked. Did you find a fix for the problem? – Lubed Up Slug Jan 09 '18 at 09:09
  • No I did not. I ended up reinstalling my conda environments. :/ – codebrotherone Jan 18 '18 at 21:06
  • Are you using anaconda? – codebrotherone Jan 18 '18 at 22:17

1 Answers1

0

For me it seems like Anaconda related issue.

Try to run python in ipython notebook or pycharm and select which environment you want to use.

jupyter notebook

Also if you create conda virtual environment it should allow you to use python as is.

conda create -n myenv python=3.4
source activate myenv

Another soution might be to remove anaconda from the PATH variable