Comments (8)
This has been fixed now, thanks all!
from python_blockchain_app.
from python_blockchain_app.
hmm, is markupsafe being used by flask? or requests?
Those are the only two dependencies the project uses.
from python_blockchain_app.
here is the full traceback
(.venv) C:\test\python_blockchain_app>flask run --port 8000
Traceback (most recent call last):
File "C:\Program Files\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\test\python_blockchain_app\.venv\Scripts\flask.exe\__main__.py", line 4, in <module>
File "C:\test\python_blockchain_app\.venv\lib\site-packages\flask\__init__.py", line 14, in <module>
from jinja2 import escape
File "C:\test\python_blockchain_app\.venv\lib\site-packages\jinja2\__init__.py", line 12, in <module>
from .environment import Environment
File "C:\test\python_blockchain_app\.venv\lib\site-packages\jinja2\environment.py", line 25, in <module>
from .defaults import BLOCK_END_STRING
File "C:\test\python_blockchain_app\.venv\lib\site-packages\jinja2\defaults.py", line 3, in <module>
from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401
File "C:\test\python_blockchain_app\.venv\lib\site-packages\jinja2\filters.py", line 13, in <module>
from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (C:\test\python_blockchain_app\.venv\lib\site-packages\markupsafe\__init__.py)
so markupsafe is a dependency of jinja2 that is a dependency of flask.
You can reproduce the issue following these steps:
- clone repo and cd into the folder
- create a clean python virtual environment
python -m venv .venv
- activate the environment
.venv\Scripts\activate
- install requirements
pip install -r requirements.txt
- set FLASK_APP as shown in the readme
export FLASK_APP=node_server.py
orset FLASK_APP=node_server.py
on windows - start server
flask run --port 8000
<-- this is the line that generates the above exception
addingmarkupsafe==2.0.1
to requirements fixes the issue. This is because they made a breaking change in version 2.1 removing soft_unicode, see the issue that i linked in my original post.
from python_blockchain_app.
Got it, thanks for the details!
from python_blockchain_app.
- flask run --port 8000
i added markupsafe==2.0.1 to requirements
then run command pip install -r requirements.txt, it's successful but still generate above exception
from python_blockchain_app.
from python_blockchain_app.
@hwangzh are you sure that the correct version of markupsafe is installed? I just tried and it works.
from python_blockchain_app.
Related Issues (20)
- What prevents a new node with a bigger chain to join and deceive everyone? HOT 1
- Quick question about deploying this to share with my class
- How can we generate desired hash code ? HOT 1
- Submit transaction to all miners HOT 3
- Blockchain data goes to node 8000/chain HOT 2
- Can´t execute the Blockchain HOT 1
- Error HOT 1
- 1
- Transaction size HOT 1
- requests.exceptions.ConnectionError HOT 4
- Tutorial no longer accessible HOT 2
- e
- in run_app.py 'app' is not defined HOT 1
- timestamp is not included when calculate genesis block HOT 2
- Localhost 5000 & 8000 can not work. HOT 1
- Containerise this?
- OpenAPI API spec HOT 1
- Server error HOT 2
- How can retrieve transactions and how many transaction in one block? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python_blockchain_app.