nLabs-nScope/nScopeAPI

Error building pip3 install git+git://XXX

kranked354 opened this issue · 2 comments

There doesn't seem to be a 'setup.py' file located in the repository, so after it get's cloned by this command it brings up the following error:

Collecting git+https://github.com/nLabs-nScope/nScopeAPI.git
  Cloning https://github.com/nLabs-nScope/nScopeAPI.git to /private/var/folders/2y/99vg8x596bjd5_t3y3tt7z9c0000gn/T/pip-098ooyy5-build
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tokenize.py", line 452, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/2y/99vg8x596bjd5_t3y3tt7z9c0000gn/T/pip-098ooyy5-build/setup.py'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/2y/99vg8x596bjd5_t3y3tt7z9c0000gn/T/pip-098ooyy5-build/

The key part being "No such file" : 'setup.py'

Is there another way to build this library?

Copying the file nScopePy directly into my local directory then just brings up the following error too:

Traceback (most recent call last):
  File "/Users/XXXX/PycharmProjects/BCI/PyBCI.py", line 1, in <module>
    import nScopePy as ns       # import the nScopePy module
  File "/Users/XXXX/PycharmProjects/BCI/nScopePy.py", line 14, in <module>
    nScopeAPI = CDLL(os.path.join(os.path.dirname(__file__), "../mac/libnscope.so"))
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/__init__.py", line 345, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/XXXX/PycharmProjects/BCI/../mac/libnscope.so, 6): image not found

Even when I copy the rest of the files into that expressed directory (including /mac/libnscope.so) the error remains.

It clearly needs a setup.py file to be written and contained to make it simple.
I'll try copying the setup.py file from pyserial and rewrite appropriately and test that out.

I've tried making the following 'setup.py' file:

# setup.py for nScopePy
#
# Direct install (all systems):
#   "python setup.py install"
#
# For Python 3.x use the corresponding Python executable,
# e.g. "python3 setup.py ..."
#
# (C) 2001-2016 ----
#
# SPDX-License-Identifier:    ----
import io
import os
import re

try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup


def read(*names, **kwargs):
    """Python 2 and Python 3 compatible text file reading.
    Required for single-sourcing the version string.
    """
    with io.open(
        os.path.join(os.path.dirname(__file__), *names),
        encoding=kwargs.get("encoding", "utf8")
    ) as fp:
        return fp.read()


def find_version(*file_paths):
    """
    Search the file for a version string.
    file_path contain string path components.
    Reads the supplied Python module as text without importing it.
    """
    version_file = read(*file_paths)
    version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
                              version_file, re.M)
    if version_match:
        return version_match.group(1)
    raise RuntimeError("Unable to find version string.")


version = '0.7'


setup(
    name="nScopePy",
    description="Python nScope reader",
    version=version,
    author="--",
    author_email="--",
    url="https://github.com/nLabs-nScope/nScopeAPI",
    packages=['nScopePy'], #ERROR HERE
    license="XXX",
    long_description="""\
Python nScope reader for Win32, OSX, Linux, Python
https://github.com/nLabs-nScope/nScopeAPI
""",
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'Intended Audience :: End Users/Desktop',
        'License :: OSI Approved :: BSD License',
        'Natural Language :: English',
        'Operating System :: POSIX',
        'Operating System :: Microsoft :: Windows',
        'Operating System :: MacOS :: MacOS X',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.2',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Topic :: Communications',
        'Topic :: Software Development :: Libraries',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: Terminals :: Serial',
    ],
    platforms='any',
    scripts=['python/program.py'],
)

It's giving an error where I've annotated:

running install
running bdist_egg
running egg_info
writing nScopePy.egg-info/PKG-INFO
writing dependency_links to nScopePy.egg-info/dependency_links.txt
writing top-level names to nScopePy.egg-info/top_level.txt
error: package directory 'nScopeAPI' does not exist

I've tried nScopeAPI, nScopePy, python/nScopePy... not a clue what I'm doing here.
Would love just to record some data at a set frequency - not much.