Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conda command failure #6171

Closed
ghost opened this issue Sep 27, 2017 · 18 comments
Closed

conda command failure #6171

ghost opened this issue Sep 27, 2017 · 18 comments

Comments

@ghost
Copy link

ghost commented Sep 27, 2017

I created a new environment for tensorflow following instructions from this repo
When restarted my computer and launched anaconda command prompt
I received following message and conda command was not recognized:
usage: conda [-h]
{keygen,sign,unsign,verify,unpack,install,install-scripts,convert,version,help}
...
conda: error: invalid choice: '..checkenv' (choose from 'keygen', 'sign', 'unsign', 'verify', 'unpack', 'install', 'install-scripts', 'convert', 'version', 'help')
I tried launching anaconda using navigator

Navigator Error
An unexpected error occurred on Navigator start-up
Report
Please report this issue in the anaconda issue tracker
Main Error

byte indices must be integers or slices, not str

Traceback

Traceback (most recent call last):
File "C:\Users\XXXX\Anaconda3\lib\site-packages\anaconda_navigator\exceptions.py", line 75, in exception_handler
return_value = func(*args, **kwargs)
File "C:\Users\XXXX\Anaconda3\lib\site-packages\anaconda_navigator\app\start.py", line 115, in start_app
window = run_app(splash)
File "C:\Users\XXXX\Anaconda3\lib\site-packages\anaconda_navigator\app\start.py", line 58, in run_app
window = MainWindow(splash=splash)
File "C:\Users\XXXX\Anaconda3\lib\site-packages\anaconda_navigator\widgets\main_window.py", line 160, in init
self.api = AnacondaAPI()
File "C:\Users\XXXX\Anaconda3\lib\site-packages\anaconda_navigator\api\anaconda_api.py", line 1205, in AnacondaAPI
ANACONDA_API = _AnacondaAPI()
File "C:\Users\XXXX\Anaconda3\lib\site-packages\anaconda_navigator\api\anaconda_api.py", line 65, in init
self._conda_api = CondaAPI()
File "C:\Users\XXXX\Anaconda3\lib\site-packages\anaconda_navigator\api\conda_api.py", line 1622, in CondaAPI
CONDA_API = _CondaAPI()
File "C:\Users\XXXX\Anaconda3\lib\site-packages\anaconda_navigator\api\conda_api.py", line 340, in init
self.set_conda_prefix()
File "C:\Users\XXXX\Anaconda3\lib\site-packages\anaconda_navigator\api\conda_api.py", line 489, in set_conda_prefix
self.ROOT_PREFIX = info['root_prefix']
TypeError: byte indices must be integers or slices, not str

I am using Windows 64 bit system

@goanpeca
Copy link

See Issue #1837 for more information on how to fix this.


Closing as duplicate of #1837


Please remember to update to the latest version of Navigator to include
the latest fixes.

Open a terminal (on Linux or Mac) or the Anaconda Command Prompt (on windows)
and type:

$ conda update anaconda-navigator
$ conda update navigator-updater

@ghost
Copy link
Author

ghost commented Sep 27, 2017

Conda command just does not work to do a conda update

@goanpeca
Copy link

@midhubalan what is the error when running the conda command from the terminal/anaconda-prompt

@Braveheart53
Copy link

Braveheart53 commented Sep 27, 2017

Multiple of these same issues have been posted and closed by the same person. With the fully updated conda suggested as well as

./conda update --all

I have not included anconda in my path as to not interfer with the system version of python, but I have used aliases to run as required. Just to list the full return again with fully update anaconda3 at 1013 EST on 2017-09-27 on a fully up-to-date Fedora 26 x64 KDE spin system with a version downloaded yesterday:


./anaconda-navigator 

An unexpected error occurred on Navigator start-up byte indices must be integers or slices, not str
Traceback (most recent call last): 
  File "/home/xxxx/anaconda3/lib/python3.6/site-packages/anaconda_navigator/exceptions.py", line 75, in exception_handler
    return_value = func(*args, **kwargs)
  File "/home/xxx/anaconda3/lib/python3.6/site-packages/anaconda_navigator/app/start.py", line 120, in start_app
    window = run_app(splash)
  File "/home/xxxx/anaconda3/lib/python3.6/site-packages/anaconda_navigator/app/start.py", line 63, in run_app
    window = MainWindow(splash=splash)
  File "/home/xxxx/anaconda3/lib/python3.6/site-packages/anaconda_navigator/widgets/main_window.py", line 160, in __init__
    self.api = AnacondaAPI()
  File "/home/xxxx/anaconda3/lib/python3.6/site-packages/anaconda_navigator/api/anaconda_api.py", line 1214, in AnacondaAPI
    ANACONDA_API = _AnacondaAPI()
  File "/home/xxxx/anaconda3/lib/python3.6/site-packages/anaconda_navigator/api/anaconda_api.py", line 65, in __init__
    self._conda_api = CondaAPI()
  File "/home/xxxx/anaconda3/lib/python3.6/site-packages/anaconda_navigator/api/conda_api.py", line 1654, in CondaAPI
    CONDA_API = _CondaAPI()
  File "/home/xxxx/anaconda3/lib/python3.6/site-packages/anaconda_navigator/api/conda_api.py", line 345, in __init__
    self.set_conda_prefix()
  File "/home/xxxx/anaconda3/lib/python3.6/site-packages/anaconda_navigator/api/conda_api.py", line 494, in set_conda_prefix
    self.ROOT_PREFIX = info['root_prefix']
TypeError: byte indices must be integers or slices, not str

Segmentation fault (core dumped)'

Running as regular user, running conda for update works either as an alias or within the local bin directory. Do you suggest installing as root or super users and putting in an area such as /opt and giving 777 or 775 permissions?

@msarahan
Copy link
Contributor

You have somehow picked up a conda version that is out of sync with the activate scripts. To remedy this, I think you might need to do a fresh install of anaconda or miniconda from the .exe installers.

@ghost
Copy link
Author

ghost commented Sep 27, 2017

@goanpeca conda command is not recognized i get the following message when i start the conda prompt.
usage: conda [-h]
{keygen,sign,unsign,verify,unpack,install,install-scripts,convert,version,help}
...
conda: error: invalid choice: '..checkenv' (choose from 'keygen', 'sign', 'unsign', 'verify', 'unpack', 'install', 'install-scripts', 'convert', 'version', 'help')
I tried launching anaconda using navigator

@eng-tsmith
Copy link

eng-tsmith commented Oct 6, 2017

I am having the same problem:
Yesterday everything was running perfectly. After rebooting today it isnt.
No conda command is working., e.g. :
activate root --> conda: error: invalid choice: '..checkenv'
conda update anaconda-navigator --> conda: error: invalid choice: 'update'
etc....

@Mistty
Copy link

Mistty commented Oct 23, 2017

after I interupted a anaconda prompt...when restart
usage: conda [-h]
{keygen,sign,unsign,verify,unpack,install,install-scripts,convert,version,help}
...
conda: error: invalid choice: '..checkenv' (choose from 'keygen', 'sign', 'unsign', 'verify', 'unpack', 'install', 'install-scripts', 'convert', 'version', 'help')

and then nothing could save it for now....

@JerryKurata
Copy link

Brand new installation of Anaconda3 on Windows 10 system. When the system is restarted I get the following:

C:\Users\jerry\Anaconda3>conda update
usage: conda [-h]
{keygen,sign,unsign,verify,unpack,install,install-scripts,convert,version,help}
...
conda: error: invalid choice: 'update' (choose from 'keygen', 'sign', 'unsign', 'verify', 'unpack', 'install', 'install-scripts', 'convert', 'version', 'help')

Directly running conda.exe outputs the following, NOTICE, No Update option:

C:\Users\jerry\Anaconda3>conda.exe
usage: conda [-h]
{keygen,sign,unsign,verify,unpack,install,install-scripts,convert,version,help}
...

positional arguments:
{keygen,sign,unsign,verify,unpack,install,install-scripts,convert,version,help}
commands
keygen Generate signing key
sign Sign wheel
unsign Remove RECORD.jws from a wheel by truncating the zip
file. RECORD.jws must be at the end of the archive.
The zip file must be an ordinary archive, with the
compressed files and the directory in the same order,
and without any non-zip content after the truncation
point.
verify Verify a wheel. The signature will be verified for
internal consistency ONLY and printed. Wheel's own
unpack/install commands verify the manifest against
the signature and file contents.
unpack Unpack wheel
install Install wheels
install-scripts Install console_scripts
convert Convert egg or wininst to wheel
version Print version and exit
help Show this help

optional arguments:
-h, --help show this help message and exit

Please let me know what I am doing wrong

@yiran-THU
Copy link

@goanpeca

conda update anaconda-navigator
conda update navigator-updater

This command doesn't work ,my OS is win10(64),python3.5

@JerryKurata
Copy link

JerryKurata commented Oct 26, 2017

I did some more investigation. In my case, the problem was with Google TensorFlow. Their PIP based installation inside an enviroment replace conda.exe with an older/broke version. Since I need TensorFlow more than environments I have to, unfortunately, abandon environments until this is fixed. But, since Google says that Conda is community supported, not sure if they will do anything.

The command that causes the replacement is : pip install --ignore-installed --upgrade tensorflow-gpu
Some other posting lead me to believe that the --ignore-install and --upgrade options are problematic, but do not know enough about PIP to pursue this. Does anyone else know how these options work and could break conda?

@jjhelmus
Copy link
Contributor

@JerryKurata Can you provide some more details on how conda is breaking when you pip install tensorflow? I followed the instructions for installing tensorflow on Windows with Anaconda and had no issue running conda afterwords.

It should be safe to not include the --ignore-installed and --upgrade arguments from the install command but I would be interested in learning more about what was causing the breakage.

@JerryKurata
Copy link

JerryKurata commented Oct 26, 2017

@jjhelmus Sure. Here is what I did.

  • Downloaded and ran anaconda 5.0.1 for windows installed. Selected 64-bit graphical installer. Took defaults.
  • added c:\user\jerry\Anaconda3 and c:\user\jerry\Anacona3\scripts to my path so I could use the conda command from command line
  • created environment with the command "conda create -n tf-test python=3.6 numpy scipy matplotlib spyder"
  • checked date last updated for c:\user\jerry\Anaconda3\script\conda.exe. Date showed time of installation.
  • Activate environment with "activate tf-test"
  • Per instruction on https://www.tensorflow.org/install/install_windows ran the command "pip install --ignore-installed --upgrade tensorflow-gpu"
  • checked date last updated for c:\user\jerry\Anaconda3\script\conda.exe. Date showed time before date of installation.
  • But, conda command works
  • Reboot system
  • create new terminal session
  • activate tf-test - ERROR
  • Try conda command - ERROR -
    "usage: conda [-h]
    {keygen,sign,unsign,verify,unpack,install,install-scripts,convert,version,help}
    ...
    conda: error: invalid choice: 'update' (choose from 'keygen', 'sign', 'unsign', 'verify', 'unpack', 'install', 'install-scripts', 'convert', 'version', 'help')"

I appreciate any guidance you can provide. I am probably doing something dumb. Thanks in advance.

@awt135
Copy link

awt135 commented Nov 12, 2017

usage: conda [-h]
{keygen,sign,unsign,verify,unpack,install,install-scripts,convert,version,help}
...
conda: error: invalid choice: '..checkenv' (choose from 'keygen', 'sign', 'unsign', 'verify', 'unpack', 'install', 'install-scripts', 'convert', 'version', 'help')

i installed the TensorFlow on windows normally ,the same of upstairs,but when i reboot the windows , the result is same wrong.

@JerryKurata
Copy link

A little more information on working around this. I made a copy of my Anaconda3\scripts folder before installing tensorflow-gpu. Then installed tensorflow-gpu. After installing tensorflow-gpu, the conda.exe was replaced with the incorrect version. But I could replace it with the correct version of conda.exe from my copy and get it going.

@jwangjie
Copy link

I solved my problem following this: https://stackoverflow.com/a/46493533/8936445

In short, after activating the created environment, instead of "pip install --ignore-installed --upgrade tensorflow-gpu", use "pip install tensorflow-gpu".

@vncntprvst
Copy link

Another way of fixing this issue, if one has a restore point available, is to go to the scripts folder (e.g. C:\ProgramData\Anaconda2\Scripts ) , right-click on conda.exe and select "Restore previous version".

@akhilgeothom
Copy link

If this message coming up every time you start the terminal (linux) is what is annoying you and led you here,
then just edit the .bashrc file by removing all lines related to conda init.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests