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

scripts pysmt, pysmt-shell, pysmt-install fail with import errors #48

Closed
rhishi opened this Issue Mar 15, 2015 · 4 comments

Comments

Projects
None yet
3 participants
@rhishi

rhishi commented Mar 15, 2015

I did pip install pysmt, but when I run any of the scripts, I get an import error.

On running pysmt or pysmt-shell: ImportError: No module named shell
On running pysmt-install: ImportError: No module named install

Did you guys simply miss including install.py, shell.py while building the pypi package? I'm seeing the following diff between
https://github.com/pysmt/pysmt/archive/v0.2.3.tar.gz and https://pypi.python.org/packages/source/p/pySMT/PySMT-0.2.3.tar.gz:

diff -rq pysmt-0.2.3-github/ pysmt-0.2.3-pypi/

Only in pysmt-0.2.3-github/: .gitignore
Only in pysmt-0.2.3-github/: NOTICE
Only in pysmt-0.2.3-pypi/: PKG-INFO
Only in pysmt-0.2.3-pypi/: PySMT.egg-info
Only in pysmt-0.2.3-github/: SMT-LIB
Files pysmt-0.2.3-github/docs/CHANGES.rst and pysmt-0.2.3-pypi/docs/CHANGES.rst differ
Only in pysmt-0.2.3-github/docs: Makefile
Only in pysmt-0.2.3-github/docs: code_snippets
Only in pysmt-0.2.3-github/docs: conf.py
Only in pysmt-0.2.3-github/: examples
Only in pysmt-0.2.3-github/: health_check.sh
Only in pysmt-0.2.3-github/: install.py
Only in pysmt-0.2.3-github/: make_distrib.sh
Only in pysmt-0.2.3-github/: patches
Only in pysmt-0.2.3-github/pysmt/test: configs
Only in pysmt-0.2.3-github/pysmt/test/smtlib: bin
Only in pysmt-0.2.3-github/pysmt/test/smtlib: small_set
Only in pysmt-0.2.3-github/: run_all_tests.sh
Only in pysmt-0.2.3-github/: run_tests.sh
Only in pysmt-0.2.3-pypi/: setup.cfg
Only in pysmt-0.2.3-github/: shell.py
Only in pysmt-0.2.3-github/: shippable.sh
Only in pysmt-0.2.3-github/: shippable.yml

@mikand

This comment has been minimized.

Show comment
Hide comment
@mikand

mikand Mar 15, 2015

Contributor

Hi rhishi,
thanks for the report!

I just tried in a fresh docker container and I can confirm the issue.

Contributor

mikand commented Mar 15, 2015

Hi rhishi,
thanks for the report!

I just tried in a fresh docker container and I can confirm the issue.

@mikand

This comment has been minimized.

Show comment
Hide comment
@mikand

mikand Mar 15, 2015

Contributor

Indeed it seems that install.py and shell.py are not distributed:

root@8481ee8f196c:/usr/local/lib/python2.7/dist-packages# ls
PySMT-0.2.3.egg-info  virtualenv-12.0.7.egg-info  virtualenv.pyc
pysmt             virtualenv.py       virtualenv_support
root@8481ee8f196c:/usr/local/lib/python2.7/dist-packages# cd pysmt/
root@8481ee8f196c:/usr/local/lib/python2.7/dist-packages/pysmt# ls
__init__.py    factory.py     oracles.py      smtlib
__init__.pyc       factory.pyc    oracles.pyc     solvers
configuration.py   fnode.py   printers.py     substituter.py
configuration.pyc  fnode.pyc      printers.pyc    substituter.pyc
decorators.py      formula.py     randomizer.py   test
decorators.pyc     formula.pyc    randomizer.pyc  type_checker.py
environment.py     logics.py      shortcuts.py    type_checker.pyc
environment.pyc    logics.pyc     shortcuts.pyc   typing.py
exceptions.py      operators.py   simplifier.py   typing.pyc
exceptions.pyc     operators.pyc  simplifier.pyc  walkers
Contributor

mikand commented Mar 15, 2015

Indeed it seems that install.py and shell.py are not distributed:

root@8481ee8f196c:/usr/local/lib/python2.7/dist-packages# ls
PySMT-0.2.3.egg-info  virtualenv-12.0.7.egg-info  virtualenv.pyc
pysmt             virtualenv.py       virtualenv_support
root@8481ee8f196c:/usr/local/lib/python2.7/dist-packages# cd pysmt/
root@8481ee8f196c:/usr/local/lib/python2.7/dist-packages/pysmt# ls
__init__.py    factory.py     oracles.py      smtlib
__init__.pyc       factory.pyc    oracles.pyc     solvers
configuration.py   fnode.py   printers.py     substituter.py
configuration.pyc  fnode.pyc      printers.pyc    substituter.pyc
decorators.py      formula.py     randomizer.py   test
decorators.pyc     formula.pyc    randomizer.pyc  type_checker.py
environment.py     logics.py      shortcuts.py    type_checker.pyc
environment.pyc    logics.pyc     shortcuts.pyc   typing.py
exceptions.py      operators.py   simplifier.py   typing.pyc
exceptions.pyc     operators.pyc  simplifier.pyc  walkers

marcogario added a commit that referenced this issue Mar 15, 2015

Fixed binaries in pypi distribution (#48)
Added directory pysmt/cmd for commands/binaries to distribute. This
makes the importing of these "utilities" cleaner, since now they are
within the pysmt module. I.e., pysmt.cmd.install .
@marcogario

This comment has been minimized.

Show comment
Hide comment
@marcogario

marcogario Mar 15, 2015

Contributor

Fixed in PR #50.

@rhishi thank you very much for letting us know. The fix has been pushed to pypi in a pre-release version of 0.2.4 (you can install it using the --pre option in pip). We will make a full release of 0.2.4 by the end of the day.

Contributor

marcogario commented Mar 15, 2015

Fixed in PR #50.

@rhishi thank you very much for letting us know. The fix has been pushed to pypi in a pre-release version of 0.2.4 (you can install it using the --pre option in pip). We will make a full release of 0.2.4 by the end of the day.

@marcogario marcogario closed this Mar 15, 2015

@rhishi

This comment has been minimized.

Show comment
Hide comment
@rhishi

rhishi Mar 16, 2015

Thanks for such a quick fix, Marco and Andrea! I'm looking forward to using pySMT. I came to it while looking for python interface for CVC4. What you're building is even better: a simple expression language, and a solver-agnostic interface. I'm hoping it to be quite useful in my project.

Also, I stumbled upon the above bug when trying to build a conda package for pySMT. You might be aware that conda is (yet another) package manager, which comes with the Anaconda python distribution. With the bug fixed, I was able to build a pySMT package for conda, using the following commands:

conda skeleton pypi pysmt
conda build pysmt

I uploaded the resulting package at https://binstar.org/rhishi/pysmt. It can be installed using the following command:

conda install -c https://conda.binstar.org/rhishi pysmt

rhishi commented Mar 16, 2015

Thanks for such a quick fix, Marco and Andrea! I'm looking forward to using pySMT. I came to it while looking for python interface for CVC4. What you're building is even better: a simple expression language, and a solver-agnostic interface. I'm hoping it to be quite useful in my project.

Also, I stumbled upon the above bug when trying to build a conda package for pySMT. You might be aware that conda is (yet another) package manager, which comes with the Anaconda python distribution. With the bug fixed, I was able to build a pySMT package for conda, using the following commands:

conda skeleton pypi pysmt
conda build pysmt

I uploaded the resulting package at https://binstar.org/rhishi/pysmt. It can be installed using the following command:

conda install -c https://conda.binstar.org/rhishi pysmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment