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

Running setup.sh aborts with Exception: TypeError: __cal__() takes exactly 2 arguments (1 given) #432

Closed shchukax closed 7 years ago

shchukax commented 7 years ago

I'm attempting to install sync engine on a mint 17 box (based on ubuntu 14.04). Running setup.sh goes through for a bit and then errors out with the following message:

Collecting nylas-production-python>=0.3.9 (from -r requirements.txt (line 1))
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading nylas-production-python-0.3.9.tar.gz
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 634, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 412, in run_egg_info
    self.setup_py, self.name,
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 387, in setup_py
    import setuptools  # noqa
  File "/usr/local/lib/python2.7/dist-packages/setuptools/__init__.py", line 12, in <module>
    import setuptools.version
  File "/usr/local/lib/python2.7/dist-packages/setuptools/version.py", line 1, in <module>
    import pkg_resources
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 72, in <module>
    import packaging.requirements
  File "/usr/local/lib/python2.7/dist-packages/packaging/requirements.py", line 59, in <module>
    MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() takes exactly 2 arguments (1 given)

How can I get past this error?

ronisbr commented 7 years ago

I am getting the same error and I already reported here: #431

I received no answer from the devs at all.

mikethebeer commented 7 years ago

I also have this issue. Seems to be an issue with the old installed python version and pip. As a workaround I installed the latest version of python2.7.13 from the tarball.

tar -xzf python-2.7.13.tgz
cd Python/
sudo ./configure
sudo make
sudo make install

after that run sudo ./setup.sh again and it should work fine.

ronisbr commented 7 years ago

@mikethebeer

Installing the latest python version did not solve my problem when running the virtual machine using vagrant.

I modified setup.sh to install the newest python, but it still fails.

shchukax commented 7 years ago

I tried with Python 2.7.13 and even with Python 3.4 (this doesn't work for a variety of other reasons) - to no avail. What finally did fix it for me is this:

In file /usr/local/lib/python2.7/dist-packages/packaging/requirements.py, line 59 is this one:

MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")

I changed it to

MARKER_EXPR = originalTextFor(MARKER_EXPR(""))("marker")

And that was it - everything went through after that.

andrepiske commented 7 years ago

@shchukax Thanks, that indeed works!

ghost commented 7 years ago

@shchukax Thanks, it works for me.

whmountains commented 7 years ago

How do the nylas guys make this work? I thought vagrant was supposed to give us a 100% identical build.

@grinich can you weight in on this?

itsjef commented 7 years ago

In order to fix problems with building the sync-engine, including: #427, #429, #430, #431

Here is what I add into my setup.sh:

export PYTHONPATH=/vagrant:$PYTHONPATH
echo "export PYTHONPATH=/vagrant:$PYTHONPATH" >> /etc/profile
sed -i '59s/MARKER_EXPR()/MARKER_EXPR("")/g' /usr/local/lib/python2.7/dist-packages/packaging/requirements.py

after apt-get -y install ... in line 100

and easy_install -U pyasn1 setuptools

after pip install ... in line 180

Destroy the vagrant box and run vagrant up again, things seem to work fine for me :)

rmandar16 commented 7 years ago

@shchukax, great solution! It worked! Many thanks!

hmalshe commented 7 years ago

@shchukax great fix! Thanks!

JNingWei commented 7 years ago

pip install setuptools==33.1.1

porsche613 commented 7 years ago

pip install setuptools==33.1.1 or pip install --upgrade setuptools (when confirmed using a old version) are ok