QuantSoftware / QuantSoftwareToolkit

QuantSoftwareToolkit
Other
464 stars 215 forks source link

Installation does not work with python 2.7.5 on MAC Mavericks #54

Closed sdrdis closed 10 years ago

sdrdis commented 10 years ago

I tried to install it with the installation script but it was throwing me the same error than later ("QSTK is a namespace package...").

I then tried to upload the latest zip from https://pypi.python.org/packages/source/Q/QSTK/, and launched sudo python setup.py install. Here is the result :

> sudo python setup.py install
running install
Checking .pth file support in /Library/Python/2.7/site-packages/
/usr/bin/python -E -c pass
TEST PASSED: /Library/Python/2.7/site-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing requirements to QSTK.egg-info/requires.txt
writing QSTK.egg-info/PKG-INFO
writing namespace_packages to QSTK.egg-info/namespace_packages.txt
writing top-level names to QSTK.egg-info/top_level.txt
writing dependency_links to QSTK.egg-info/dependency_links.txt
error: Namespace package problem: QSTK is a namespace package, but its
__init__.py does not call declare_namespace()! Please fix it.
(See the setuptools manual under "Namespace Packages" for details.)

I tried to launch it with python2.5 and it was not sending this error message... It doesn't seem that there is a lot to fix, just adding a line in a init.py file, but I don't know exactly...

Thanks :)

tuckerbalch commented 10 years ago

Thanks, we will take a look.

On Apr 13, 2014, at 4:07 PM, Sébastien Drouyer notifications@github.com wrote:

I tried to install it with the installation script but it was throwing me the same error than later ("QSTK is a namespace package...").

I then tried to upload the latest zip from https://pypi.python.org/packages/source/Q/QSTK/, and launched sudo python setup.py install. Here is the result :

sudo python setup.py install running install Checking .pth file support in /Library/Python/2.7/site-packages/ /usr/bin/python -E -c pass TEST PASSED: /Library/Python/2.7/site-packages/ appears to support .pth files running bdist_egg running egg_info writing requirements to QSTK.egg-info/requires.txt writing QSTK.egg-info/PKG-INFO writing namespace_packages to QSTK.egg-info/namespace_packages.txt writing top-level names to QSTK.egg-info/top_level.txt writing dependency_links to QSTK.egg-info/dependency_links.txt error: Namespace package problem: QSTK is a namespace package, but its init.py does not call declare_namespace()! Please fix it. (See the setuptools manual under "Namespace Packages" for details.)

I tried to launch it with python2.5 and it was not sending this error message... It doesn't seem that there is a lot to fix, just adding a line in a init.py file, but I don't know exactly...

Thanks :)

— Reply to this email directly or view it on GitHub.

paux commented 10 years ago

I get the same error on Ubuntu 14.04, with both QSTK-0.2.6 and 0.2.7. (python2.7)

misterkabir commented 10 years ago

Here's the fix:

  1. Open init.py in a text editor
  2. Add the line "declare_namespace('QSTK')" without quotes.
  3. sudo python setup.py install
  4. After installation, open the Cellar folder where init.py is installed. I used the terminal command "open /usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/QSTK-0.2.7-py2.7.egg/QSTK/" without quotes to open where it was located for me.
  5. Remove the declare_namespace('QSTK') line from init.py (Hint: easiest way to do it is to replace it with the original downloaded init.py file.

I sent a pull request with the update. Hope that helps.

Note: the underscores wrapping init.py don't show up in my comment.

Torishniy commented 10 years ago

Have the same problem. Can you tell me which init.py file I have to edit at the first step? Thanks!

misterkabir commented 10 years ago

@Torishniy The one located in the QSTK folder. Here's the patch for 0.2.6: https://github.com/misterkabir/QuantSoftwareToolkit/blob/patch-1/QSTK/__init__.py

Torishniy commented 10 years ago

Thank you very much! It works!

sb2nov commented 10 years ago

7a03300bb6ada9ae005149d2880ca5ec7235826b fixes it