nylas / sync-engine

:incoming_envelope: IMAP/SMTP sync system with modern APIs
https://nylas.com/docs/platform
GNU Affero General Public License v3.0
3.5k stars 354 forks source link

bin/create-db: inbox.config No module named config [SOLVED] #429

Closed Aegefel closed 7 years ago

Aegefel commented 7 years ago

Hi, I followed this tutorial to install Nylas Sync Engine on Ubuntu 16.10 but I can't get it works. I tried to run it with python 3.5 but it doesn't works so I used python 2.7. When I launch sudo -H setup.sh It automatically downgrade pip to the version 8.1.2 Ensuring setuptools and pip versions... Collecting pip==8.1.2 Using cached pip-8.1.2-py2.py3-none-any.whl Requirement already satisfied: setuptools>=5.3 in /usr/lib/python2.7/dist-packages Installing collected packages: pip Found existing installation: pip 9.0.1 Uninstalling pip-9.0.1: Successfully uninstalled pip-9.0.1 Successfully installed pip-8.1.2

Then it says: Copying default mysql configuration to /etc/mysql/conf.d 2017-01-21T18:54:39.330729Z mysqld_safe Logging to syslog. 2017-01-21T18:54:39.332573Z mysqld_safe Logging to '/var/log/mysql/error.log'. 2017-01-21T18:54:39.334704Z mysqld_safe Logging to '/var/log/mysql/error.log'. 2017-01-21T18:54:39.336648Z mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists. Traceback (most recent call last): File "bin/create-db", line 9, in <module> from inbox.config import config ImportError: No module named config I don't know how to fix this problem. Any ideas ?

kun-zhou commented 7 years ago

427 The issue is resolved in a previous post.

Aegefel commented 7 years ago

I don't have vagrant installed so it doesn't work for me. Do I have to install vagrant ? Why is it necessary to run the sync engine ?

kun-zhou commented 7 years ago

You don't need vagrant if that is your preference. I have the sync engine up and running on a remote amazon virtual machine without using vagrant, just run the setup.sh. You do need to install a few failed dependencies using easy_install along the way. I also remember needing to fix a few permission issues for the folders. Make sure you are in the the immediate mother directory of bin.

Also, you might want to reinstall MySQL if you've installed it before because the configurations can differ.

UPDATE: Notice that the previous post added /vagrant to the front of its sys.path, if you are not using vagrant, you might have a different path. For me, it was /home/kunzhou/sync-engine.

Aegefel commented 7 years ago

Thank you. I added the lines sys.path = ["/home/aegefel/Desktop/nylas_tmp/sync-engine"] + [p for p in sys.path if p != "/home/aegefel/Desktop/nylas_tmp/sync-engine"] in inbox-auth, inbox-api, inbox-start and create-db and it worked. Problem solved !

slotlocker2 commented 7 years ago

I think a more elegant solution would be to define the PYTHONPATH before running setup.sh

export PYTHONPATH=".":$PYTHONPATH bash setup.sh