jrd/pyreadpartitions

error when using pip to install

john012343210 opened this issue · 3 comments

Obtaining file:///Users/myaccountname/Desktop/pyreadpartitions
    ERROR: Command errored out with exit status 1:
     command: /opt/anaconda3/envs/openea/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/myaccountname/Desktop/pyreadpartitions/setup.py'"'"'; __file__='"'"'/Users/myaccountname/Desktop/pyreadpartitions/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/bq/gkw9g60136138jhd0k4sqzyh0000gn/T/pip-pip-egg-info-65n1xn79
         cwd: /Users/myaccountname/Desktop/pyreadpartitions/
    Complete output (9 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Users/myaccountname/Desktop/pyreadpartitions/setup.py", line 49, in <module>
        'license': find_info('license', MODULE_NAME),
      File "/Users/myaccountname/Desktop/pyreadpartitions/setup.py", line 28, in find_info
        info_match = re.search(r"^__{0}__ = {1}".format(info, python_string), info_file, re.M)
      File "/opt/anaconda3/envs/openea/lib/python3.6/re.py", line 182, in search
        return _compile(pattern, flags).search(string)
    TypeError: cannot use a string pattern on a bytes-like object

in order to remove this bug

info_match = re.search(r"^__{0}__ = {1}".format(info, python_string), info_file, re.M)

change to
info_match = re.search(r"^__{0}__ = {1}".format(info, python_string), str(info_file), re.M)

and

info_match = re.search(r"^__{0}__ = {1}".format(info, python_arrays), info_file, re.M)

change to
info_match = re.search(r"^__{0}__ = {1}".format(info, python_arrays), str(info_file), re.M)

please ignore my message, seems totoally for python 2 but not 3

jrd commented

I shall update this to Python3, won’t be hard. I will drop python2 in the process.
Probably done by this WE.

jrd commented

It’s now compatible to Python 3.6 and later.

It has been published to PyPI: https://pypi.org/project/pyreadpartitions/1.1.0/