Skip to content

AWS RedHat AMI setup.py pathing issues #8

@daniel-redder

Description

@daniel-redder

Background
I'm using a t2 ec2 instance on AWS with their RedHat ami distro.
I am using this library to query Marta for my capstone research project.
Previously I was using a raspberry pi to collect the data and send it to a mounted google drive for storage, but with internet issues corrupting my mount, I decided to switch to AWS.

Problem
I am able to run tox which runs successfully excluding errors from not having the API key set, however when I try to run setup.py it gives me the following error :

error: can't create or remove files in install directory

 sudo python3 setup.py install
running install
running bdist_egg
running egg_info
writing marta.egg-info/PKG-INFO
writing dependency_links to marta.egg-info/dependency_links.txt
writing requirements to marta.egg-info/requires.txt
writing top-level names to marta.egg-info/top_level.txt
reading manifest file 'marta.egg-info/SOURCES.txt'
writing manifest file 'marta.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
copying marta.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying marta.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying marta.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying marta.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying marta.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
Traceback (most recent call last):
  File "setup.py", line 11, in <module>
    'requests-cache'
  File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib64/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib64/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
  File "/usr/lib64/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib64/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 218, in run
    os.path.join(archive_root, 'EGG-INFO'), self.zip_safe()
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 269, in zip_safe
    return analyze_egg(self.bdist_dir, self.stubs)
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 379, in analyze_egg
    safe = scan_module(egg_dir, base, name, stubs) and safe
  File "/usr/local/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 416, in scan_module
    code = marshal.load(f)
ValueError: bad marshal data (unknown type code)

Before this, it gave me a directory doesn't exist error because my python is default installed globally in /lib/python3.7 I took the python3.7 directory and copied it into a new directory based on the path the setup.py wanted. /user/local/lib/python3.7/site-packages, and the above error is what I got. I have played with this for days googling multiple things. I thought from https://cets.seas.upenn.edu/answers/install-python-module.html that using --prefix= might solve my problems it did not. I tried following a link I got from the setup.py error https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations which leads to a blank page. I'm a bit lost on how to fix this.

My end goal is to take live data from MARTA buses every 5 minutes from an AWS ec2 instance and put them into a dynamo DB for analysis and for website presentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions