Giter Site home page Giter Site logo

Comments (16)

ronaldsnyder avatar ronaldsnyder commented on July 21, 2024 1

Are you using a Mac? This sounds similar to issue 34, #34

These are the steps that @ChristianTremblay gave me before that fixed it.

It is probably related to some kind of permission of the "system's python" version.
To be able to make it work, you will need to use a virtual env that will isolate you from the system's python.
Here is a simple guide : http://docs.python-guide.org/en/latest/dev/virtualenvs/
You will need to :

sudo pip install virtualenv
mkdir your project folder
cd project
virtualenv venv
source venv/bin/activate

Once you are in your virtual env DO NOT use sudo to pip install.
(in fact, this is the part that made me think of permission issue as I read somewhere that we should never sudo pip install anything)

So now you are in your virtual env (it's in parenthesis in the console) and you

pip install requests
pip install hszinc
pip install pyhaystack
(note that this time you won't see any weird message when trying to install pandas and you need xcode to perform the install....)
You are now able to :

import hszinc
hszinc.MODE_ZINC

from pyhaystack.client.skyspark import SkysparkHaystackSession

from pyhaystack.

sjlongland avatar sjlongland commented on July 21, 2024

from pyhaystack.

p2ya avatar p2ya commented on July 21, 2024

pip install hszinc

from pyhaystack.

ChristianTremblay avatar ChristianTremblay commented on July 21, 2024

Does it work if you don't specify the format ?

Also, if using version 0.92 (latest), can you test using

'''
Import pyhaystack
session=pyhaystack.connect("skyspark", uri, user,password)
'''

We may face something related to authentication. The class you are loading isn't meant for Skyspark v3+

Using connect, when specifying "skyspark" the default implementation will use scram authentication.

from pyhaystack.

p2ya avatar p2ya commented on July 21, 2024

No, it doesn't.

Checked versions:

pip show pyhaystack

Name: pyhaystack
Version: 0.92
Location: /usr/local/lib/python2.7/site-packages
Requires: requests, setuptools, pandas, parsimonious, iso8601, hszinc, six, fysom, signalslot, semver

pip show hszinc

Name: hszinc
Version: 0.1.1
Location: /usr/local/lib/python2.7/site-packages
Requires: parsimonious, pytz, iso8601, six, pint

Also when I tried the connect() approach I got the following error:

Code:
import pyhaystack
session = pyhaystack.connect(implementation='skyspark',
uri='http://ip',
username='username',
password='password',
project='site'
)

Error:

session = pyhaystack.connect(implementation='skyspark',
AttributeError: 'module' object has no attribute 'connect'

from pyhaystack.

p2ya avatar p2ya commented on July 21, 2024

I am testing that on SkySpark version 2.1.15

from pyhaystack.

ChristianTremblay avatar ChristianTremblay commented on July 21, 2024

Humm... AttributeError: 'module' object has no attribute 'connect'is telling me there is a problem with the install..

Can you uninstall pyhaystack and hszinc then reinstall ?
I've faced that kind of problem before but I thought it was because I was alterning between a local repo and pip install.... anyway.

pip uninstall pyhsyatck (multiple time until there is no version left on your system)
pip uninstall hszinc (mutliple time again if needed)

then pip install pyhaytsack it should install hszinc

from pyhaystack.

p2ya avatar p2ya commented on July 21, 2024

did the uninstall and installed pyhaystack
but it has the same errors for both direct and connect approach

from pyhaystack.

ronaldsnyder avatar ronaldsnyder commented on July 21, 2024

from pyhaystack.

p2ya avatar p2ya commented on July 21, 2024

tried the sudo and same error

from pyhaystack.

p2ya avatar p2ya commented on July 21, 2024

is there any chance that you test it for SkySpark and see if it work ?

from pyhaystack.

sjlongland avatar sjlongland commented on July 21, 2024

I personally don't have access to SkySpark… but my hunch is there's a dependent Python module (of hszinc) that isn't loading for some reason.

That is why there's an AttributeError.

from pyhaystack.

ChristianTremblay avatar ChristianTremblay commented on July 21, 2024

I've also had some problem with pip unable to uninstall things... you could also check to update pip :
python -m pip install --upgrade pip
Then uninstall pyhaystack
the attribute erroris not normal as it tells that function connect doesn't exist...

I've just tested a Skyspark v2 connection :

import pyhaystack

session = pyhaystack.connect('skyspark2', uri='http://ip',
                                username='user',
                                password='pw',
                                project = 'myProject')

session.about().result

Please note that implementation for old Skyspark version is skyspark2 and we chose 'skyspark`as the shortcut for v3+ which will probably become the "by default" option anyway.

This also led to a bug discovered with bracket search... guess I'll open an issue and publish a hot fix....

from pyhaystack.

p2ya avatar p2ya commented on July 21, 2024

Hi Ron
Worked like a charm, thanks for the help.
I will carry on using the package.

from pyhaystack.

ChristianTremblay avatar ChristianTremblay commented on July 21, 2024

I will add this to our documentation. It will probably help others.
Thanks @ronaldsnyder

from pyhaystack.

ChristianTremblay avatar ChristianTremblay commented on July 21, 2024

Documentation has been updated in develop branch

from pyhaystack.

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.