Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

TypeError: bytes or integer address expected instead of str instance #1

Closed
PazzaVlad opened this issue May 14, 2016 · 2 comments
Closed

Comments

@PazzaVlad
Copy link

Hi!)
I tried to install your plugin, but when I try to run "python manage.py makemigrations" python raise an error:
I use python 3.5 and django 1.9.6.
traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/Users/silva/Documents/Sandbox/galaxy-droid-models-django/myenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line utility.execute() File "/Users/silva/Documents/Sandbox/galaxy-droid-models-django/myenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 327, in execute django.setup() File "/Users/silva/Documents/Sandbox/galaxy-droid-models-django/myenv/lib/python3.5/site-packages/django/__init__.py", line 18, in setup apps.populate(settings.INSTALLED_APPS) File "/Users/silva/Documents/Sandbox/galaxy-droid-models-django/myenv/lib/python3.5/site-packages/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry) File "/Users/silva/Documents/Sandbox/galaxy-droid-models-django/myenv/lib/python3.5/site-packages/django/apps/config.py", line 90, in create module = import_module(entry) File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 986, in _gcd_import File "<frozen importlib._bootstrap>", line 969, in _find_and_load File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 673, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 662, in exec_module File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed File "/Users/silva/Documents/Sandbox/galaxy-droid-models-django/myenv/lib/python3.5/site-packages/tinymce/__init__.py", line 14, in <module> from .models import HTMLField File "/Users/silva/Documents/Sandbox/galaxy-droid-models-django/myenv/lib/python3.5/site-packages/tinymce/models.py", line 8, in <module> from tinymce.widgets import TinyMCE, AdminTinyMCE File "/Users/silva/Documents/Sandbox/galaxy-droid-models-django/myenv/lib/python3.5/site-packages/tinymce/widgets.py", line 24, in <module> import enchant File "/Users/silva/Documents/Sandbox/galaxy-droid-models-django/myenv/lib/python3.5/site-packages/enchant/__init__.py", line 92, in <module> from enchant import _enchant as _e File "/Users/silva/Documents/Sandbox/galaxy-droid-models-django/myenv/lib/python3.5/site-packages/enchant/_enchant.py", line 121, in <module> prefix_dir.contents = c_char_p(e_dir) TypeError: bytes or integer address expected instead of str instance (myenv) Vlads-MacBook-Pro:gdmodels silva$

@romanvm
Copy link
Owner

romanvm commented May 15, 2016

I cannot reproduce your error. From the traceback I see that the exception is thrown in pyenchant module, specifically in the piece of code responsible for initializing pyenchant on OS-X systems.
Try import enchant from Python console in your virtual environment and see if it works.

Also pyenchant depends on binary enchant libraries. On Windows pyenchant distributable includes all necessary binary components, but, for example, on Linux enchant library needs to be installed separately. I don't know how it's distributed on OS-X.

If pyenchant is indeed broken on OS-X, then it's up to the package maintainers to fix it.

@PazzaVlad
Copy link
Author

Thanks!
"import enchant" output the same error. I also tried install it on Ubuntu and it works fine, so you are right about OS X

romanvm pushed a commit that referenced this issue Jun 1, 2016
…g when pyenchant was still imported with spellchecker disabled. Also fixes #1 on systems where pyenchant is unavailable or broken.
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants