Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: str argument expected with fresh install on Python 3.10.1 #65

Open
InnovativeInventor opened this issue Jun 4, 2022 · 7 comments

Comments

@InnovativeInventor
Copy link

On Python 3.10.1, a fresh pip install us yields this TypeError:

Python 3.10.1 (main, Dec 22 2021, 05:19:12) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import us
>>> us.states.lookup('maryland')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/max/.pyenv/versions/3.10.1/lib/python3.10/site-packages/us/states.py", line 86, in lookup
    val = jellyfish.metaphone(val)
TypeError: str argument expected

This is the output of pip freeze:

$ pip freeze
jellyfish==0.6.1
us==2.0.2

Is this a known issue?

@InnovativeInventor InnovativeInventor changed the title TypeError: str argument expected TypeError: str argument expected with fresh install on Python 3.10.1 Jun 4, 2022
@InnovativeInventor
Copy link
Author

Huh, so I manually uninstalled jellyfish (since 0.6.1 looks old) and force-installed a more recent issue, which seemed to fix the issue. However, it looks like jellyfish is currently pinned to 0.6.1 for the latest release on PyPI because pip threw me this warning:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
us 2.0.2 requires jellyfish==0.6.1, but you have jellyfish 0.9.0 which is incompatible.

Perhaps it is worth bumping jellyfish to a more recent version?

@rgreinho
Copy link

As a quick workaround to get the state information from the full name, I used this:

abbrev = states.mapping('name','abbr').get("Maryland")
state = states.lookup(abbrev)

and then you can access all the fields

>>> state.capital
'Annapolis'
>>> state.fips
'24'

The only gotcha is that the full name MUST be capitalized.

@InnovativeInventor
Copy link
Author

@jcarbaugh is this project actively maintained? I'd be willing to help maintain this package, if that is welcome.

@rgreinho
Copy link

I could also help if more maintainer help is needed.

@NickCrews
Copy link

Perhaps it is worth bumping jellyfish to a more recent version?

As a clarification, since this is a library, I believe that this shouldn't be pinned to a specific jellyfish version, but a range.
eg jellyfish>=0.8.0 not jellyfish==0.8.0

For instance, in my app I might have a requirement for jellyfish>=0.9.0, but if this library is hard pinned to jellyfish==0.8.0, then those two requirements are incompatible and I'm going to get that install error.

@InnovativeInventor
Copy link
Author

Perhaps it is worth bumping jellyfish to a more recent version?

As a clarification, since this is a library, I believe that this shouldn't be pinned to a specific jellyfish version, but a range. eg jellyfish>=0.8.0 not jellyfish==0.8.0

For instance, in my app I might have a requirement for jellyfish>=0.9.0, but if this library is hard pinned to jellyfish==0.8.0, then those two requirements are incompatible and I'm going to get that install error.

Yeah, I agree with this. I assume jellyfish was pinned for some reason, but I do not know what that reason is.

@NickCrews
Copy link

NickCrews commented Sep 12, 2022

I think this is actually an upstream issue with jellyfish: jamesturk/jellyfish#160

but updating to jellyfish>=0.9.0 DID fix it for me. So I'm not quite sure what version of jellyfish / version of python the bug began showing up. If anyone can clarify, please do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants