ValueError: unsupported format character - trying to source activate new anaconda environments

0 views
Skip to first unread message

Liam Considine

unread,
Apr 22, 2018, 6:39:38 PM4/22/18
to Anaconda - Public
Hello, 

I've just started using anaconda to manage my python packages and versions for multiple projects. 

Here's my issue: 
I'm on a Mac OSX El Capitan 10.11.6

I have a project that requires python 3.5... so:

conda create -n py35 python=3.5 anaconda

That runs fine, I say yes install all the packages runs fine. 

→ conda info --envs
# conda environments:
#
base                  *  /Users/liam/anaconda2
py35                     /Users/liam/anaconda2/envs/py35

Then when I go to activate the source: 

source activate py35 

I get the following error. 
→ source activate py35
Traceback (most recent call last):
  File "/Users/liam/anaconda2/lib/python2.7/site-packages/conda/gateways/logging.py", line 64, in emit
    msg = self.format(record)
  File "/Users/liam/anaconda2/lib/python2.7/logging/__init__.py", line 734, in format
    return fmt.format(record)
  File "/Users/liam/anaconda2/lib/python2.7/logging/__init__.py", line 465, in format
    record.message = record.getMessage()
  File "/Users/liam/anaconda2/lib/python2.7/logging/__init__.py", line 329, in getMessage
    msg = msg % self.args
  File "/Users/liam/anaconda2/lib/python2.7/site-packages/conda/__init__.py", line 43, in __repr__
    return '%s: %s' % (self.__class__.__name__, text_type(self))
  File "/Users/liam/anaconda2/lib/python2.7/site-packages/conda/__init__.py", line 47, in __str__
    return text_type(self.message % self._kwargs)
ValueError: unsupported format character 'b' (0x62) at index 534
Logged from file exceptions.py, line 770

I can't tell why this happens!!! Driving me nuts.

→ which python
/Users/liam/anaconda2/bin/python
→ which anaconda
/Users/liam/anaconda2/bin/anaconda
→ conda info

     active environment : None
            shell level : 0
       user config file : /Users/liam/.condarc
 populated config files :
          conda version : 4.4.10
    conda-build version : 3.4.1
         python version : 2.7.14.final.0
       base environment : /Users/liam/anaconda2  (writable)
           channel URLs : https://repo.continuum.io/pkgs/main/osx-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/osx-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/osx-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/osx-64
                          https://repo.continuum.io/pkgs/pro/noarch
          package cache : /Users/liam/anaconda2/pkgs
                          /Users/liam/.conda/pkgs
       envs directories : /Users/liam/anaconda2/envs
                          /Users/liam/.conda/envs
               platform : osx-64
             user-agent : conda/4.4.10 requests/2.18.4 CPython/2.7.14 Darwin/15.6.0 OSX/10.11.6
                UID:GID : 502:20
             netrc file : None
           offline mode : False

Thanks for any input




Liam Considine

unread,
Apr 22, 2018, 6:50:17 PM4/22/18
to Anaconda - Public
For whatever reason: 

conda config --set changeps1 False

Fixed the issue... 

Nehal J Wani

unread,
Apr 22, 2018, 6:51:46 PM4/22/18
to anac...@continuum.io, ljc...@gmail.com
Liam,

Could you share the output for:

echo $PS1

Does it have the characters '%b' in it?


Cheers!

Nehal J Wani

--
Community Discussion Forum for Anaconda
---
You received this message because you are subscribed to the Google Groups "Anaconda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anaconda+unsubscribe@continuum.io.
To post to this group, send email to anac...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/anaconda/.

Liam Considine

unread,
Apr 22, 2018, 6:54:25 PM4/22/18
to Anaconda - Public, ljc...@gmail.com
Yes it does! 

\w \e[0;31m$(~/.rvm/bin/rvm-prompt) \[\e[0;32m\]$(vcprompt -f '%b')\[\e[0m\] \n→

What's the right way to fix this? I need rvm to still work... 

What is $PS1?


Cheers!

Nehal J Wani

To unsubscribe from this group and stop receiving emails from it, send an email to anaconda+u...@continuum.io.

Kale Franz

unread,
Apr 22, 2018, 7:25:16 PM4/22/18
to anac...@continuum.io, ljc...@gmail.com
What's the right way to fix this?

Start with `conda update conda`. If you can still reproduce the error with conda 4.5.1, file a new issue at github.com/conda/conda/issues

Sent from my iPhone

Liam Considine

unread,
Apr 22, 2018, 8:15:41 PM4/22/18
to Anaconda - Public, ljc...@gmail.com
Updating and then:
conda config --set changeps1 true
Resolved the issue. . . now displays active env on my terminal

Matt Curcio

unread,
Apr 22, 2018, 11:42:39 PM4/22/18
to anac...@continuum.io
I am no expert but why do all your error codes relate to Anaconda 2 and NOT 3? There is a way to get 3.5 with Anaconda for download and installation. I would hazard a guess that your system is looking for dependencies with 3.5 and is only finding 2.7.

Did you load the right package? 

Liam Considine

unread,
Apr 22, 2018, 11:46:19 PM4/22/18
to Anaconda - Public
I'm using Anaconda2 because the work I started doing required python 2.7 - I tried installing Anaconda3 on top of it to get the three kernel in my jupyter notebooks but it wasn't really straight forward. Anaconda2 still lets me make python3 environments so it's not appearing to be an issue. 

As Kale Franz indicated upgrading to the latest conda fixed the issue with my exported $PS1 value in .bash_profile

Matt Curcio

unread,
Apr 23, 2018, 12:00:23 AM4/23/18
to anac...@continuum.io
So you are saying, you tried to install 3.5 and was not able to? I know in the past you can install both side by side. 

I guess I would suggest trying a couple of things. First I would try to check the md5 for your latest download and and make sure it is ok. Then possibly re-install if that was the issue. Alternatively If you are feeling brave and have some time you could just go the pip or apt install route. I have tried this method in other circumstances. I looked up what packages were required from the Anaconda python 3.5 or 3.6 set and methodically as i could went thru the list making sure I got the right dependencies. 

I should add I do not work for Anaconda and my advice is free... but I feel logically the answer was in front of me...
HTH

Liam Considine

unread,
Apr 23, 2018, 4:39:04 PM4/23/18
to Anaconda - Public
Hey Matt, 

We appear to be talking past each other hah! My problem was addressed by Nehal and Kale's suggestions. There was a bug in conda that would lock up on non utf-8 characters in the $PS1 value which I had set in .bash_profile. The link I provided, to the original github issue gave me a workaround (conda config --set changeps1 False) , and then upgrading conda gave me a permanent fix. 

Thanks for the help!
-liam
Reply all
Reply to author
Forward
0 new messages