OpenTelemetry Python: gevent monkey patch errors when using auto instrumentation - open-telemetry

I am trying auto instrumentation for python, referring to https://opentelemetry.io/docs/instrumentation/python/getting-started/ Everything works fine.
However, after I added the gevent monkey patch at the beginning, like this.
from gevent import monkey
monkey.patch_all()
from random import randint
from flask import Flask, request
app = Flask(__name__)
#app.route("/rolldice")
def roll_dice():
return str(do_roll())
def do_roll():
return randint(1, 6)
Then the errors comes out when running opentelemetry-instrument command.
(my-3.9) gaolvyang:ot-python$ opentelemetry-instrument --traces_exporter console --metrics_exporter console flask run
/home/gaolvyang/project/ot-python/app.py:2: MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. It may also silently lead to incorrect behaviour on Python 3.7. Please monkey-patch earlier. See https://github.com/gevent/gevent/issues/1016. Modules that had direct imports (NOT patched): ['urllib3.util (/home/gaolvyang/.pyenv/versions/3.9.15/envs/my-3.9/lib/python3.9/site-packages/urllib3/util/__init__.py)', 'urllib3.util.ssl_ (/home/gaolvyang/.pyenv/versions/3.9.15/envs/my-3.9/lib/python3.9/site-packages/urllib3/util/ssl_.py)'].
monkey.patch_all()
Traceback (most recent call last):
File "/home/gaolvyang/.pyenv/versions/my-3.9/bin/flask", line 8, in <module>
sys.exit(main())
File "/home/gaolvyang/.pyenv/versions/3.9.15/envs/my-3.9/lib/python3.9/site-packages/flask/cli.py", line 1047, in main
cli.main()
File "/home/gaolvyang/.pyenv/versions/3.9.15/envs/my-3.9/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/gaolvyang/.pyenv/versions/3.9.15/envs/my-3.9/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/gaolvyang/.pyenv/versions/3.9.15/envs/my-3.9/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/gaolvyang/.pyenv/versions/3.9.15/envs/my-3.9/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/gaolvyang/.pyenv/versions/3.9.15/envs/my-3.9/lib/python3.9/site-packages/click/decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/home/gaolvyang/.pyenv/versions/3.9.15/envs/my-3.9/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/gaolvyang/.pyenv/versions/3.9.15/envs/my-3.9/lib/python3.9/site-packages/flask/cli.py", line 911, in run_command
raise e from None
File "/home/gaolvyang/.pyenv/versions/3.9.15/envs/my-3.9/lib/python3.9/site-packages/flask/cli.py", line 897, in run_command
app = info.load_app()
File "/home/gaolvyang/.pyenv/versions/3.9.15/envs/my-3.9/lib/python3.9/site-packages/flask/cli.py", line 312, in load_app
app = locate_app(import_name, None, raise_if_not_found=False)
File "/home/gaolvyang/.pyenv/versions/3.9.15/envs/my-3.9/lib/python3.9/site-packages/flask/cli.py", line 218, in locate_app
__import__(module_name)
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 161, in __exit__
File "<frozen importlib._bootstrap>", line 116, in release
RuntimeError: cannot release un-acquired lock
If I run flask run without using opentelemetry-instrument, it works fine.
Seems cannot use opentelemetry-instrument and gevent monkey patch at the same time.
Would anybody help with this? Thanks!

Related

Discord Bot crashing: typeerror __new__() got an unexpected keyword argument 'deny_new'

I was making a bot just for fun and tested it on my Test Server and everything worked perfect. But when I try to get it into another server it crashes.
I get this in the cmd:
Traceback (most recent call last):
File "botardo.py", line 19, in <module>
client.run('token')
File "C:\Users\kakob\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 598, in run
return future.result()
File "C:\Users\kakob\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 579, in runner
await self.start(*args, **kwargs)
File "C:\Users\kakob\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 543, in start
await self.connect(reconnect=reconnect)
File "C:\Users\kakob\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 457, in connect
await self._connect()
File "C:\Users\kakob\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 421, in _connect
await self.ws.poll_event()
File "C:\Users\kakob\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\gateway.py", line 469, in poll_event
await self.received_message(msg)
File "C:\Users\kakob\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\gateway.py", line 423, in received_message
func(data)
File "C:\Users\kakob\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\state.py", line 663, in parse_guild_create
guild = self._get_create_guild(data)
File "C:\Users\kakob\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\state.py", line 641, in _get_create_guild
return self._add_guild_from_data(data)
File "C:\Users\kakob\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\state.py", line 255, in _add_guild_from_data
guild = Guild(data=guild, state=self)
File "C:\Users\kakob\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\guild.py", line 280, in __init__
self._from_data(data)
File "C:\Users\kakob\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\guild.py", line 391, in _from_data
self._sync(guild)
File "C:\Users\kakob\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\guild.py", line 420, in _sync
self._add_channel(VoiceChannel(guild=self, data=c, state=self._state))
File "C:\Users\kakob\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\channel.py", line 504, in __init__
self._update(guild, data)
File "C:\Users\kakob\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\channel.py", line 535, in _update
self._fill_overwrites(data)
File "C:\Users\kakob\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\abc.py", line 271, in _fill_overwrites
self._overwrites.append(_Overwrites(id=overridden_id, **overridden))
TypeError: __new__() got an unexpected keyword argument 'deny_new'
I've seen some other posts about this error, but what most intrigues me is that it works on my Test server but not on any other. Any ideas?
Thanks!
Reinstalling discord.py should fix the problem

Error the deployment function in lambda with graphene module

error when executing the function in aws lambda, while locally there is no error.
When executing the code in AWS lambda this error arises, what I want is to be able to use graqpl to perform dynamodb queries and to use them.
Solution attempt: uninstall typing from the python virtual environment.
Error that occurs:
[ERROR] AttributeError: type object 'Callable' has no attribute '_abc_registry'
Traceback (most recent call last):
File "/var/lang/lib/python3.7/imp.py", line 234, in load_module
return load_source(name, filename, file)
File "/var/lang/lib/python3.7/imp.py", line 171, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 696, in _load
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/var/task/patron4.py", line 7, in <module>
import graphene
File "/tmp/sls-py-req/graphene/__init__.py", line 3, in <module>
from .types import (
File "/tmp/sls-py-req/graphene/types/__init__.py", line 2, in <module>
from graphql import ResolveInfo
File "/tmp/sls-py-req/graphql/__init__.py", line 27, in <module>
from .graphql import graphql
File "/tmp/sls-py-req/graphql/graphql.py", line 1, in <module>
from .execution import ExecutionResult
File "/tmp/sls-py-req/graphql/execution/__init__.py", line 21, in <module>
from .executor import execute, subscribe
File "/tmp/sls-py-req/graphql/execution/executor.py", line 14, in <module>
from promise import Promise, promise_for_dict, is_thenable
File "/tmp/sls-py-req/promise/__init__.py", line 18, in <module>
from .promise import (
File "/tmp/sls-py-req/promise/promise.py", line 8, in <module>
from typing import (List, Any, Callable, Dict, Iterator, Optional, # flake8: noqa
File "/tmp/sls-py-req/typing.py", line 1357, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/tmp/sls-py-req/typing.py",enter code here line 1005, in __new__
self._abc_registry = extra._abc_registry
Code used:
class User(Model):
class Meta:
table_name = 'patron2'
region = 'us-east-2'
host = 'https://dynamodb.us-east-2.amazonaws.com'
id = UnicodeAttribute(hash_key=True, null=False)
discipline = UnicodeAttribute(null=False)
class UserNode(PynamoObjectType):
class Meta:
model = User
interfaces = (graphene.Node,)
class Query(graphene.ObjectType):
users = graphene.List(UserNode)
def resolve_users(self, args, context, info):
return list(User.scan())
schema = graphene.Schema(query=Query)
def patrongrafico(event, context):
# fetch all todos from the database
try:
print("hola")
query = '''
users {
discipline
}
'''
results = schema.execute(query)
print(results)
except Exception as ex:
print(ex)
return {'statusCode': 200,
'body': json.dumps({'items': [dict(result) for result in results]})}
Since you're using the Serverless Framework in combination with the serverless-python-requirements plugin you should make sure, that slim packaging is off, as this interferes with some libraries. Essentially some libraries assume they're installed via a "real" package manager and in that case the directory layout and files look slightly different.
I was having this problem with the jsonschema package a few months ago and wrote about it in a blog post if you're interested (Full disclosure: this is the blog of my employer).
Essentially your serverless.yml as a custom section which you can use among other things to configure the plugins:
custom:
pythonRequirements:
slim: true
The slim true parameter effectively removes some information that shouldn't be necessary for most libraries, but some rely on it. For information on this parameter see the package's docs.
Try again with this configuration:
custom:
pythonRequirements:
slim: false
The solution to the error is to remove the version of Python 3.7 and implement 3.6, since Graphene does not support versions greater than 3.6.

Trouble in Installing through pip3

I am trying to install packages through pip3
pip3 install keras
But, the error is as follows:
Collecting keras
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python3/dist-packages/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/sessions.py", line 521, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3/dist-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/adapters.py", line 405, in send
conn = self.get_connection(request.url, proxies)
File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/adapters.py", line 303, in get_connection
proxy_manager = self.proxy_manager_for(proxy)
File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/adapters.py", line 197, in proxy_manager_for
**proxy_kwargs)
File "/usr/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/poolmanager.py", line 440, in proxy_from_url
return ProxyManager(proxy_url=url, **kw)
File "/usr/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/poolmanager.py", line 391, in __init__
raise ProxySchemeUnknown(proxy.scheme)
urllib3.exceptions.ProxySchemeUnknown: Not supported proxy scheme
My institute needs a proxy and I updated proxy at all places in my system using ProxyMan.
Is it due to proxy? Because I had fresh install of Linux. If because of proxy, where do i need to update proxy?
I had a similar issue and I solved it by adding my proxy settings at the end of /etc/bash.bashrc like this:
export http_proxy="http://<user>:<pass>#<proxy>:<port>
export https_proxy="https://<user>:<pass>#<proxy>:<port>
export ftp_proxy="ftp://<user>:<pass>#<proxy>:<port>
export socks_proxy="socks://<user>:<pass>#<proxy>:<port>
You can try to use easy_install + packagename instead of pip.

Celery not starting in OS X - dbm.error: db type is dbm.gnu, but the module is not available

I'm trying to run celery worker in OS X (Mavericks). I activated virtual environment (python 3.4) and tried to start Celery with this argument:
celery worker --app=scheduling -linfo
Where scheduling is my celery app.
But I ended up with this error: dbm.error: db type is dbm.gnu, but the module is not available
Complete stacktrace:
Traceback (most recent call last):
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/kombu/utils/__init__.py", line 320, in __get__
return obj.__dict__[self.__name__]
KeyError: 'db'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/other/PhoenixEnv/bin/celery", line 9, in <module>
load_entry_point('celery==3.1.9', 'console_scripts', 'celery')()
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/__main__.py", line 30, in main
main()
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bin/celery.py", line 80, in main
cmd.execute_from_commandline(argv)
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bin/celery.py", line 768, in execute_from_commandline
super(CeleryCommand, self).execute_from_commandline(argv)))
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bin/base.py", line 308, in execute_from_commandline
return self.handle_argv(self.prog_name, argv[1:])
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bin/celery.py", line 760, in handle_argv
return self.execute(command, argv)
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bin/celery.py", line 692, in execute
).run_from_argv(self.prog_name, argv[1:], command=argv[0])
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bin/worker.py", line 175, in run_from_argv
return self(*args, **options)
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bin/base.py", line 271, in __call__
ret = self.run(*args, **kwargs)
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bin/worker.py", line 209, in run
).start()
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/worker/__init__.py", line 100, in __init__
self.setup_instance(**self.prepare_args(**kwargs))
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/worker/__init__.py", line 141, in setup_instance
self.blueprint.apply(self, **kwargs)
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bootsteps.py", line 221, in apply
step.include(parent)
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bootsteps.py", line 347, in include
return self._should_include(parent)[0]
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bootsteps.py", line 343, in _should_include
return True, self.create(parent)
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/worker/components.py", line 220, in create
w._persistence = w.state.Persistent(w.state, w.state_db, w.app.clock)
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/worker/state.py", line 161, in __init__
self.merge()
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/worker/state.py", line 169, in merge
self._merge_with(self.db)
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/kombu/utils/__init__.py", line 322, in __get__
value = obj.__dict__[self.__name__] = self.__get(obj)
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/worker/state.py", line 238, in db
return self.open()
File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/worker/state.py", line 165, in open
self.filename, protocol=self.protocol, writeback=True,
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/shelve.py", line 239, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/shelve.py", line 223, in __init__
Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/dbm/__init__.py", line 91, in open
"available".format(result))
dbm.error: db type is dbm.gnu, but the module is not available
Please help.
I switched to python3.5 and got the same error. On Ubuntu I could fix it with
aptitude install python3.5-gdbm
I got the same error. On Macbook I could fix it with
brew install gdb

ipython notebook installation on mac os x

I am wondering if anyone has installed ipython notebook on mac OSX?
Currently I am able to run it in the terminal note but as soon as I type in the notebook version, there are problems encountered in running it.
Below is the error I have gotten:
Traceback (most recent call last): File
"/Users/tayyangki/anaconda/bin/ipython", line 9, in
load_entry_point('ipython==2.0.0-dev', 'console_scripts', 'ipython')() File
"/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/init.py",
line 118, in start_ipython
return launch_new_instance(argv=argv, **kwargs) File "/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/config/application.py",
line 565, in launch_instance
app.initialize(argv) File "", line 2, in initialize File
"/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/config/application.py",
line 92, in catch_config_error
return method(app, *args, **kwargs) File "/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/terminal/ipapp.py",
line 314, in initialize
super(TerminalIPythonApp, self).initialize(argv) File "", line 2, in initialize File
"/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/config/application.py",
line 92, in catch_config_error
return method(app, *args, **kwargs) File "/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/core/application.py",
line 371, in initialize
self.parse_command_line(argv) File "/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/terminal/ipapp.py",
line 309, in parse_command_line
return super(TerminalIPythonApp, self).parse_command_line(argv) File "", line 2, in parse_command_line File
"/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/config/application.py",
line 92, in catch_config_error
return method(app, *args, **kwargs) File "/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/config/application.py",
line 474, in parse_command_line
return self.initialize_subcommand(subc, subargv) File "", line 2, in initialize_subcommand File
"/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/config/application.py",
line 92, in catch_config_error
return method(app, *args, **kwargs) File "/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/config/application.py",
line 405, in initialize_subcommand
subapp = import_item(subapp) File "/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/utils/importstring.py",
line 42, in import_item
module = import(package, fromlist=[obj]) File "/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/html/notebookapp.py",
line 75, in
from IPython.consoleapp import IPythonConsoleApp File "/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/consoleapp.py",
line 43, in
from IPython.kernel.zmq.kernelapp import ( File "/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/kernel/zmq/kernelapp.py",
line 54, in
from .ipkernel import Kernel File "/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/kernel/zmq/ipkernel.py", line 40, in
from .zmqshell import ZMQInteractiveShell File "/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/kernel/zmq/zmqshell.py", line 36, in
from IPython.core.payloadpage import install_payload_page File "/Users/tayyangki/anaconda/lib/python2.7/site-packages/ipython-2.0.0_dev-py2.7.egg/IPython/core/payloadpage.py",
line 24, in
from docutils.core import publish_string File "/Users/tayyangki/anaconda/lib/python2.7/site-packages/docutils/core.py",
line 20, in
from docutils import frontend, io, utils, readers, writers File "/Users/tayyangki/anaconda/lib/python2.7/site-packages/docutils/frontend.py",
line 41, in
import docutils.utils File "/Users/tayyangki/anaconda/lib/python2.7/site-packages/docutils/utils/init.py",
line 20, in
import docutils.io File "/Users/tayyangki/anaconda/lib/python2.7/site-packages/docutils/io.py",
line 18, in
from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput File
"/Users/tayyangki/anaconda/lib/python2.7/site-packages/docutils/utils/error_reporting.py",
line 47, in
locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1] File
"/Users/tayyangki/anaconda/lib/python2.7/locale.py", line 511, in
getdefaultlocale
return _parse_localename(localename) File "/Users/tayyangki/anaconda/lib/python2.7/locale.py", line 443, in
_parse_localename
raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: UTF-8
Greatly appreciated if someone could help me?
As noted here, the workaround for the "unknown locale: UTF-8" issue to add:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
to your to your ~/.bash_profile.
thanks for the info but I have found out the problems a few weeks ago and have forgotten to post it here....
It is just that for Mac installation, it is pretty tricky and hence while installing, instead of typing in: easy_install ipython, users have to specify the python version.
Thus, I will need to type in easy_install ipython2.7
After which all is fine and working great!

Resources