Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error when installing pysqlcipher #11

Closed
dionyziz opened this issue Oct 14, 2014 · 6 comments
Closed

Syntax error when installing pysqlcipher #11

dionyziz opened this issue Oct 14, 2014 · 6 comments

Comments

@dionyziz
Copy link

When installing pysqlcipher in Python 3 on mac using pip for OpenBazaar, I get the following error:

Downloading/unpacking pysqlcipher==2.6.3-1 (from -r requirements.txt (line 11))
  Downloading pysqlcipher-2.6.3-1.tar.gz (69kB): 69kB downloaded
  Running setup.py (path:/private/var/folders/ty/nt50gpgx1737thg9ll863bj80000gn/T/pip_build_dionyziz/pysqlcipher/setup.py) egg_info for package pysqlcipher
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/private/var/folders/ty/nt50gpgx1737thg9ll863bj80000gn/T/pip_build_dionyziz/pysqlcipher/setup.py", line 65
        print "CFLAGS", os.environ['CFLAGS']
                     ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/private/var/folders/ty/nt50gpgx1737thg9ll863bj80000gn/T/pip_build_dionyziz/pysqlcipher/setup.py", line 65

    print "CFLAGS", os.environ['CFLAGS']

                 ^

SyntaxError: invalid syntax
@dionyziz
Copy link
Author

Any interest in this? @kalikaneko

@gubatron
Copy link

out of curiosity, how do python developers migrating to Python 3 deal with this?

the print a,b,c notation with spaces is quite common and now it's gone in favor of a functional syntax for print(a,b,c).

If you use print(a,b,c) in python 2.x you end up printing a tuple. What would be the fix here If I were to submit it to pysqlcipher? rewriting the print with conditionals depending on the current python version? or just dealing (in the case of this setup script) with ugly output if you are on python 2?

@elijh
Copy link
Member

elijh commented Oct 29, 2014

i am just learning a little python for the first time, but maybe:

print("CFLAGS " + os.environ['CFLAGS'])

or

print("CFLAGS %s" % (os.environs['CFLAGS'],))

both will be the same in python 2 and python 3

@kalikaneko
Copy link
Member

Hi. Apart from fixing this trivial syntax error, porting to python 3 might not be trivial.
Have you tried the module with python3?

@kalikaneko
Copy link
Member

the right way to deal with this should be import the print function from future module, and keep up with py3 syntax if you want to try a patch and see whether the thing breaks further on:

from __future__ import print_function
...
print(foo, bar)

however, I'm doing research to see how much would it take to port the module to py3. For the moment, I do not see python3-sqlite packaged, and the original pysqlite from which I forked this project does not state its python version compatibility table.

@dionyziz however we're right now a bit busy with releasing bitmask 0.7, so this might have to wait a little. sorry for the delay.

@kalikaneko
Copy link
Member

Closing since it's a duplicate of #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants