Giter VIP home page Giter VIP logo

Comments (12)

adamzap avatar adamzap commented on August 16, 2024

It might be this logic...but it works for me.

I'll try it on a few machines.

try:
    from landslide.generator import Generator
except ImportError:
    from generator import Generator

I thought this would work for both working with a checkout and an pip install...

from landslide.

adamzap avatar adamzap commented on August 16, 2024

n1k0, it works fine for me on an ubuntu machine that's never seen a recent version of our code. I used pip.

from landslide.

n1k0 avatar n1k0 commented on August 16, 2024

I just created a new VM running latest Ubuntu (32bits), here's the complete log:

$ sudo pip install landslide
Downloading/unpacking landslide
  Downloading landslide-0.4.0.tar.gz (51Kb): 51Kb downloaded
  Running setup.py egg_info for package landslide
    Traceback (most recent call last):
      File "<string>", line 3, in <module>
    ImportError: No module named setuptools.command
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

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

ImportError: No module named setuptools.command

----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in ./pip-log.txt
niko@ubuntu:~$ sudo apt-get install python-setuptools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  python-setuptools
0 upgraded, 1 newly installed, 0 to remove and 200 not upgraded.
Need to get 213kB of archives.
After this operation, 922kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid/main python-setuptools 0.6.10-4ubuntu1 [213kB]
Fetched 213kB in 0s (299kB/s)            
Selecting previously deselected package python-setuptools.
(Reading database ... 124159 files and directories currently installed.)
Unpacking python-setuptools (from .../python-setuptools_0.6.10-4ubuntu1_all.deb) ...
Setting up python-setuptools (0.6.10-4ubuntu1) ...

Processing triggers for python-central ...
niko@ubuntu:~$ sudo pip install landslide
Downloading/unpacking landslide
  Running setup.py egg_info for package landslide
Installing collected packages: landslide
  Running setup.py install for landslide
    changing mode of build/scripts-2.6/landslide from 644 to 755
    changing mode of /usr/local/bin/landslide to 755
Successfully installed landslide
niko@ubuntu:~$ landslide 
Traceback (most recent call last):
  File "/usr/local/bin/landslide", line 23, in <module>
    from generator import Generator
ImportError: No module named generator

from landslide.

adamzap avatar adamzap commented on August 16, 2024

Hmm ok. Thanks for doing that. It should also be installing markdown, jinja2, and pygments as requirements...

I'll keep investigating.

from landslide.

n1k0 avatar n1k0 commented on August 16, 2024

yes, and btw setuptools seems to have a pretty useful install_required method which distutils doesn't seem to have, I can see lot of python personas using it in their distributed packages...

from landslide.

adamzap avatar adamzap commented on August 16, 2024

I think I'm confusing setuptools and distutils...this is my first time to make a python package

from landslide.

n1k0 avatar n1k0 commented on August 16, 2024

(me too :D)

from landslide.

adamzap avatar adamzap commented on August 16, 2024

First i have no landslide installed, then i install it, then it works...

This is on my macbook.

○ python
Python 2.6.5 (r265:79063, May 17 2010, 13:48:52) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import landslide
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named landslide
>>> from landslide.generator import Generator
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named landslide.generator
>>> 
○ sudo pip install landslide
Downloading/unpacking landslide
  Downloading landslide-0.4.0.tar.gz (51Kb): 51Kb downloaded
  Running setup.py egg_info for package landslide
Installing collected packages: landslide
  Running setup.py install for landslide
    changing mode of build/scripts-2.6/landslide from 644 to 755
    changing mode of /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/landslide to 755
Successfully installed landslide
Cleaning up...
○ python
Python 2.6.5 (r265:79063, May 17 2010, 13:48:52) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import landslide
>>> 
○ python
Python 2.6.5 (r265:79063, May 17 2010, 13:48:52) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from landslide.generator import Generator
>>> Generator
<class landslide.generator.Generator at 0x1017bce90>
>>> 
○ landslide
Usage: landslide [options] input.md ...

Generates fancy HTML5 or PDF slideshows from Markdown sources

Options:
  -h, --help            show this help message and exit
  -b, --debug           Will display any exception trace to stdin
  -d FILE, --destination=FILE
                        The path to the to the destination file: .html or .pdf
                        extensions allowed (default: presentation.html)
  -e ENCODING, --encoding=ENCODING
                        The encoding of your files (defaults to utf8)
  -i, --embed           Embed base64-encoded images in presentation
  -t FILE, --template=FILE
                        The path to a Jinja2 compatible template file
  -o, --direct-ouput    Prints the generated HTML code to stdin; won't work
                        with PDF export
  -q, --quiet           Won't write anything to stdin (silent mode)
  -v, --verbose         Write informational messages to stdin (enabled by
                        default)

Note: PDF export requires the `prince` program: http://princexml.com/

from landslide.

adamzap avatar adamzap commented on August 16, 2024

n1k0, can you put some debug statements in /usr/local/bin/landslide to see what that import logic is really going? It should be able to import the landslide module after install...

from landslide.

n1k0 avatar n1k0 commented on August 16, 2024

Actually this is weird:

$ landslide 
Traceback (most recent call last):
  File "/usr/local/bin/landslide", line 23, in <module>
    from generator import Generator
ImportError: No module named generator
niko@ubuntu:~$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from landslide.generator import Generator
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.6/dist-packages/landslide/generator.py", line 23, in <module>
    import jinja2
ImportError: No module named jinja2

(the jinja2 error is not related, but here the interactive python shell actually finds the module, whereas the executable doesn't)

My knowledge of python is not sufficient here... :/

from landslide.

n1k0 avatar n1k0 commented on August 16, 2024

okay this one being no more, I think you can safely mark it as closed

from landslide.

adamzap avatar adamzap commented on August 16, 2024

Yay :)

from landslide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.