2

I am attempting to run Nosetests through PyCharm using a virtual environment, and am running into the following error.

encodings.CodecRegistryError: incompatible codecs in module "encodings.ascii" (/Users/Environments/work_dir/lib/python2.7/encodings/ascii.pyc)

This is only happening in PyCharm, and running the nosetests through the terminal does not cause this issue.

I recently updated to Mac Version 10.14.1 (18B75). I think this may have something to do with the issue, as in the stack trace:

File "/Users/Environments/work_dir/lib/python2.7/site-packages/pkg_resources/__init__.py", line 184, in get_supported_platform
plat = 'macosx-%s-%s' % ('.'.join(_macosx_vers()[:2]), m.group(3))

Specifically refers to the Mac version.

How do I go about solving this issue?

DjangoBlockchain
  • 534
  • 2
  • 17
  • I faced the same when I had site-packages enabled. Do you have them enabled as well? – patzm Nov 15 '18 at 13:18
  • @maddin25 I am not entirely sure how to check that, is that a PyCharm setting? – DjangoBlockchain Nov 15 '18 at 17:31
  • no, it should be a setting of your `virtualenv`. If you use `virtualenvwrapper`, then call `toggleglobalsitepackages`. Otherwise check this out: https://stackoverflow.com/a/8887511/3702319 – patzm Nov 16 '18 at 11:02

2 Answers2

0

Switched over to the Community Edition and the error no longer happens.

DjangoBlockchain
  • 534
  • 2
  • 17
0

I had special character in the project path. When removed "–" it started working.

Przemek
  • 25
  • 4