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

Chapter 8 Exercise 2 & 3 #234

Open
rserranon opened this issue Jan 11, 2022 · 5 comments
Open

Chapter 8 Exercise 2 & 3 #234

rserranon opened this issue Jan 11, 2022 · 5 comments

Comments

@rserranon
Copy link

I get this error message in Jupyter Notebook for excercises 2 & 3:

Exercise
reload(helper.HelperTest)
run(helper.HelperTest.("test_p2pkh_address"))
File "/var/folders/dm/y81m2jm566lcd943x_y5mjsw0000gn/T/ipykernel_34120/4269242462.py", line 4
run(helper.HelperTest.("test_p2pkh_address"))
^
SyntaxError: invalid syntax

@waltertschwe
Copy link

Try changing this:
run(helper.HelperTest.("test_p2pkh_address"))
to
run(helper.HelperTest("test_p2pkh_address"))

@rserranon
Copy link
Author

then I get this error

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/var/folders/dm/y81m2jm566lcd943x_y5mjsw0000gn/T/ipykernel_34120/2717280107.py in <module>
      1 # Exercise 2
      2 
----> 3 reload(helper.HelperTest)
      4 run(helper.HelperTest("test_p2pkh_address"))

/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/importlib/__init__.py in reload(module)
    138     """
    139     if not module or not isinstance(module, types.ModuleType):
--> 140         raise TypeError("reload() argument must be a module")
    141     try:
    142         name = module.__spec__.name

TypeError: reload() argument must be a module

@GKenu
Copy link

GKenu commented May 4, 2022

I'm having a similar problem. If I do this:
run(helper.HelperTest("test_p2pkh_address"))
I get back this:
run(helper.HelperTest.("test_p2pkh_address"))
SyntaxError: invalid syntax

If instead I try:
run(helper.HelperTest("test_p2pkh_address"))
I get back:
ImportError Traceback (most recent call last)
Input In [33], in <cell line: 3>()
1 # Exercise 2
----> 3 reload(helper.HelperTest)
4 run(helper.HelperTest("test_p2pkh_address"))

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py:148, in reload(module)
146 if sys.modules.get(name) is not module:
147 msg = "module {} not in sys.modules"
--> 148 raise ImportError(msg.format(name), name=name)
149 if name in _RELOADING:
150 return _RELOADING[name]

ImportError: module HelperTest not in sys.modules

@GKenu
Copy link

GKenu commented May 4, 2022

I just managed to do it in exercise 2:
The trick is to also change reload(helper.HelperTest) to reload(helper)
run(helper.HelperTest("test_p2pkh_address"))

@vvronskyFX
Copy link

This worked! Cheers for the help! 👍

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

4 participants