ox-it / python-sharepoint

A Python library for getting data out of SharePoint
BSD 3-Clause "New" or "Revised" License
126 stars 45 forks source link

bin/sharepoint error #11

Open mixmastamyk opened 10 years ago

mixmastamyk commented 10 years ago

When trying to use the command line script "sharepoint" (in Windows) I was getting an error that the "module cmd was not found."

After a lot of investigation I realized the problem was happening because the script is the same name as the package. It was importing itself and getting confused.

This happens I believe because I was in the Python\Scripts folder, as it is not on my path. Seems to work from other folders.

alexdutton commented 10 years ago

As strange as it might seem, what with it being SharePoint being an MS thing, I'be never actually tested this code on Windows.

I suspect the answer is a "from future import absolute_import" in bin/sharepoint.py. I'm not near a computer at the moment, but if I make this change tomorrow, would you be able to test it and report back?

mixmastamyk commented 10 years ago

Sure. I'm using a VM incidentally.

alexdutton commented 10 years ago

I've just pushed said commit (along with another that adds Py3 support).

mixmastamyk commented 10 years ago

Sorry, something wrong must have happened the first time. I can't reproduce the error. :(

Perhaps I can still offer something helpful. I notice your script "sharepoint" won't run on windows because it has no file extension. One way I've solved this is to include a .cmd file in the package to run it. Here is an example:

https://bitbucket.org/mixmastamyk/fr/src/default/fr.cmd

name it sharepoint.cmd . How to install it: (search for .cmd)

https://bitbucket.org/mixmastamyk/fr/src/default/setup.py

Also, I'd guess the reason your PyPi readme isn't being converted to markdown is because of the line starting with "..." as that is an .rst directive.