LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-10-2022, 10:20 AM   #1
Drosera_capensis
Member
 
Registered: Jun 2018
Posts: 153

Rep: Reputation: Disabled
Issues to run Conda on Ubuntu


Hello everyone,

My OS is Ubuntu 21.10, and I have installed Anaconda running the sh script given here:
https://www.anaconda.com/products/individual

But when I try to call the software typing "conda", I get the following error.
Would anyone have an idea where does the problem come from?

Code:
An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

    https://github.com/conda/conda/issues



Traceback (most recent call last):
  File "/home/usr/.local/lib/python3.9/site-packages/conda/exceptions.py", line 626, in conda_exception_handler
    return_value = func(*args, **kwargs)
  File "/home/usr/.local/lib/python3.9/site-packages/conda/cli/main.py", line 98, in _main
    imported = importlib.import_module(module)
  File "/home/usr/anaconda3/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/usr/.local/lib/python3.9/site-packages/conda/cli/main_list.py", line 20, in <module>
    from ..egg_info import get_egg_info
  File "/home/usr/.local/lib/python3.9/site-packages/conda/egg_info.py", line 15, in <module>
    from .misc import rel_path
  File "/home/usr/.local/lib/python3.9/site-packages/conda/misc.py", line 19, in <module>
    from .core.index import get_index, _supplement_index_with_cache
  File "/home/usr/.local/lib/python3.9/site-packages/conda/core/index.py", line 8, in <module>
    from .package_cache import PackageCache
  File "/home/usr/.local/lib/python3.9/site-packages/conda/core/package_cache.py", line 10, in <module>
    from .path_actions import CacheUrlAction, ExtractPackageAction
  File "/home/usr/.local/lib/python3.9/site-packages/conda/core/path_actions.py", line 31, in <module>
    from ..gateways.download import download
  File "/home/usr/.local/lib/python3.9/site-packages/conda/gateways/download.py", line 16, in <module>
    from ..connection import CondaSession
  File "/home/usr/.local/lib/python3.9/site-packages/conda/connection.py", line 44, in <module>
    distinfo = platform.linux_distribution()
AttributeError: module 'platform' has no attribute 'linux_distribution'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/usr/anaconda3/bin/conda", line 13, in <module>
    sys.exit(main())
  File "/home/usr/.local/lib/python3.9/site-packages/conda/cli/main.py", line 162, in main
    return conda_exception_handler(_main, *args)
  File "/home/usr/.local/lib/python3.9/site-packages/conda/exceptions.py", line 630, in conda_exception_handler
    return handle_exception(e)
  File "/home/usr/.local/lib/python3.9/site-packages/conda/exceptions.py", line 620, in handle_exception
    print_unexpected_error_message(e)
  File "/home/usr/.local/lib/python3.9/site-packages/conda/exceptions.py", line 578, in print_unexpected_error_message
    info_stdout, info_stderr = get_info()
  File "/home/usr/.local/lib/python3.9/site-packages/conda/exceptions.py", line 548, in get_info
    args.func(args, p)
  File "/home/usr/.local/lib/python3.9/site-packages/conda/cli/main_info.py", line 148, in execute
    from conda.api import get_index
  File "/home/usr/.local/lib/python3.9/site-packages/conda/api.py", line 1, in <module>
    from .core.index import get_index
  File "/home/usr/.local/lib/python3.9/site-packages/conda/core/index.py", line 8, in <module>
    from .package_cache import PackageCache
  File "/home/usr/.local/lib/python3.9/site-packages/conda/core/package_cache.py", line 10, in <module>
    from .path_actions import CacheUrlAction, ExtractPackageAction
  File "/home/usr/.local/lib/python3.9/site-packages/conda/core/path_actions.py", line 31, in <module>
    from ..gateways.download import download
  File "/home/usr/.local/lib/python3.9/site-packages/conda/gateways/download.py", line 16, in <module>
    from ..connection import CondaSession
  File "/home/usr/.local/lib/python3.9/site-packages/conda/connection.py", line 44, in <module>
    distinfo = platform.linux_distribution()
AttributeError: module 'platform' has no attribute 'linux_distribution'

Last edited by Drosera_capensis; 03-10-2022 at 10:22 AM.
 
Old 03-10-2022, 06:56 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

looks like Anaconda is assuming you are running an old, outdated version of python. According to
https://docs.python.org/2/library/pl...x_distribution
platform.linux_distribution was removed in python 3.8.

I think the best approach is to file bug/issue with Anaconda. It is a bit strange though, since that Anconda download page states
"Python 3.9"

Evo2.
 
1 members found this post helpful.
Old 03-11-2022, 06:05 AM   #3
Drosera_capensis
Member
 
Registered: Jun 2018
Posts: 153

Original Poster
Rep: Reputation: Disabled
Thank you for the answer evo2.

It is odd that Anaconda consider my version of python is 3.8.
I have made a little test:
Code:
python3.9 --version
Python 3.9.7
I think you suggest to report the issue in the Anaconda Github?
I did so, and they are suggesting I have an outdated version of conda. But I have tried several time to uninstall miniconda3 and anaconda3 and to re-install everything, and the issue persist.
 
Old 03-11-2022, 06:20 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,863

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
I guess you installed python without anaconda (on ubuntu) and also anaconda installed it for you (a different version). And now anaconda is confused about that.
 
1 members found this post helpful.
Old 03-11-2022, 07:46 AM   #5
Drosera_capensis
Member
 
Registered: Jun 2018
Posts: 153

Original Poster
Rep: Reputation: Disabled
Thanks for the clarification pan64.

I apologizes for the question, but would anybody know how to check software installed with Anaconda3 using the command "anaconda"?

Most of the tutorials I am checking now are using the "conda" command, and it is indeed the command that does not work on my computer.
 
Old 03-11-2022, 05:47 PM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

it seems I was not clear enough.
Quote:
Originally Posted by Drosera_capensis View Post
Thank you for the answer evo2.

It is odd that Anaconda consider my version of python is 3.8.
I have made a little test:
Code:
python3.9 --version
Python 3.9.7
Yes, I could see from your first post that you are using python 3.9.

Quote:
Originally Posted by Drosera_capensis View Post
I think you suggest to report the issue in the Anaconda Github?
I did so, and they are suggesting I have an outdated version of conda. But I have tried several time to uninstall miniconda3 and anaconda3 and to re-install everything, and the issue persist.
The output you posted shows that the code is trying to use a feature, platform.linux_distribution(), that has been deprecated since python 3.5 and removed in python 3.8 (that was detailed in the link I posted). It will not work with python 3.9.

Here is the important part of the error from your original post
Code:
  File "/home/usr/.local/lib/python3.9/site-packages/conda/connection.py", line 44, in <module>
    distinfo = platform.linux_distribution()
AttributeError: module 'platform' has no attribute 'linux_distribution'
Evo2.
 
  


Reply

Tags
anaconda



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How To Create Golang Virtual Environments Using Conda In Linux LXer Syndicated Linux News 0 03-27-2021 07:31 AM
LXer: How To Create Rust Virtual Environments Using Conda In Linux LXer Syndicated Linux News 0 03-13-2021 05:54 PM
LXer: How To Enable Conda-forge Channel For Conda Package Manager In Linux LXer Syndicated Linux News 0 02-21-2021 11:44 AM
LXer: Create NodeJS Virtual Environments Using Conda In Linux LXer Syndicated Linux News 0 02-20-2021 03:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration