I I'm trying to use python with conda environment.
I create an environment using
conda create -n new_env3 python=3.9
Then when I start python terminal (just running 'python') I get:
Python 3.9.12 (main, Apr 5 2022, 06:56:58)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
Segmentation fault
I tried multiple python versions and sub-versions, but all resulted in the same error
i met the same problem, and conda clean -a didn't solve the problem
$ python
Python 3.10.6 (main, Oct 24 2022, 16:07:47) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
Segmentation fault
Try running conda clean -a.
This will remove all unused packages.
Related
python3.7.12 should be the python version of the hsm environment
(hsm) leelee#ubuntu-PowerEdge-T440:~/tools/hsm-master/predict$ which python
/home/leelee/miniconda3/envs/hsm/bin/python
(hsm) leelee#ubuntu-PowerEdge-T440:~/tools/hsm-master/predict$ /home/leelee/miniconda3/envs/hsm/bin/python
Python 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:21)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
But if I type python directly, it will return a 3.9.5 python version
(hsm) leelee#ubuntu-PowerEdge-T440:~/tools/hsm-master/predict$ python
Python 3.9.5 (default, Jun 4 2021, 12:28:51)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
I guess when I type python, I entered /home/leelee/miniconda3/bin/python
(hsm) leelee#ubuntu-PowerEdge-T440:~/tools/hsm-master/predict$ which -a python
/home/leelee/miniconda3/envs/hsm/bin/python
/home/leelee/miniconda3/bin/python
(hsm) leelee#ubuntu-PowerEdge-T440:~/tools/hsm-master/predict$ /home/leelee/miniconda3/bin/python
Python 3.9.5 (default, Jun 4 2021, 12:28:51)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
Why does this happen and how can I solve it?
Looks like you added Python to the system PATH, which is not recommended when using conda. Simply check your PATH after conda activation and have a look at the sequence of the Python folders.
System: macOS Mojave 10.14.6
Python3: Python 3.7.4
My emacs config ( according to https://github.com/hlissner/doom-emacs/issues/212 );
(setq python-shell-interpreter "/usr/local/bin/python3" flycheck-python-pycompile-executable "/usr/local/bin/python3")
Trying to use run-python in emacs doom. Having:
Python 3.7.4 (v3.7.4:e09359112e, Jul 8 2019, 14:54:52)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> python.el: native completion setup failed, <class 'ModuleNotFoundError'>: No module named 'readline'
Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support readline, yet ‘python-shell-completion-native-enable’ was t and "python3" is not part of the ‘python-shell-completion-native-disabled-interpreters’ list. Native completions have been disabled locally.
import readline works perfectly in python3 in terminal.
Default python 2.7.10 doesn't work too (no my emacs config).
Python 2.7.10 (default, Feb 22 2019, 21:55:15)
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import codecs, os;__pyfile = codecs.open('''/var/folders/y3/g447wqxd4l97rk7th2fszwb00000gn/T/pyQo4DAR''', encoding='''utf-8''');__code = __pyfile.read().encode('''utf-8''');__pyfile.close();os.remove('''/var/folders/y3/g447wqxd4l97rk7th2fszwb00000gn/T/pyQo4DAR''');exec(compile(__code, '''/var/folders/y3/g447wqxd4l97rk7th2fszwb00000gn/T/pyQo4DAR''', 'exec'));
python.el: native completion setup failed, <type 'exceptions.Exception'>: libedit based readline is known not to work,
see etc/PROBLEMS under "In Inferior Python mode, input is echoed".
>>>
How to make emacs doom run python3 right?
I want to
import pybel
in jupyter-notebook and it says
The kernel appears to have died. It will restart automatically.
When I use it in python3, I get:
Python 3.6.6 | packaged by conda-forge | (default, Jul 26 2018, 09:53:17)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pybel
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_M_construct null not valid
Aborted (core dumped)
Installing using pip3 instead of conda
pip3 install pybel
works
I've successfully compiled the caffe library and the python module.
I can do this:
Jamess-Air:~ james$ python2 -V
Python 2.7.10
Jamess-Air:~ james$ python2
Python 2.7.10 (default, Jul 13 2015, 12:05:58)
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import caffe
>>>
But, bizarrely, this fails:
Jamess-Air:~ james$ python2.7 -V
Python 2.7.10
Jamess-Air:~ james$ python2.7
Python 2.7.10 (default, Jun 19 2015, 15:39:31)
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import caffe
Segmentation fault: 11
Jamess-Air:~ james$
I cannot understand this at all! Whenever I try to run using iPython notebook I get the same crash.
Any ideas as to what may be causing this, and how I might fix it, or at least get iPython Notebook to use the different python version so I can run this thing?
Thanks!
I am trying to install setuptools via an egg on my VPS. However, I keep getting an error that Python2.6 doesn't exist despite the fact that it is in $PATH:
[root#host install]# sudo sh setuptools-0.6c11-py2.6.egg
setuptools-0.6c11-py2.6.egg: line 3: exec: python2.6: not found
[root#host install]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/courier-imap/sbin:/usr/lib/courier-imap/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/wt_python/bin
[root#host install]# sudo /usr/local/wt_python/bin/python2.6
Python 2.6.5 (r265:79063, May 18 2010, 16:49:22)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
[root#host install]# sudo python2.6
Python 2.6.5 (r265:79063, May 18 2010, 16:49:22)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Any idea what could be wrong?
Thanks
1 ) sudo as root is redundant.
2 ) for a quick hack symlink your python install into a standardized path. I'm not 100% familiar with the setuptools installer, but it could spawn a subshell that would mess with environment variables. For that matter sudo depending on flags messes with environment variables.
3) If there isnt a reason why you specifically need a custom python build why not use the one in the repositories?
Hope one or a few of the ideas help.
Rob