File "/usr/bin/pip", line 9, in <module> from pip import main ImportError: cannot import name main

by XDK 9. August 2019 14:46

Exception:

File "/usr/bin/pip", line 9, in <module> from pip import main ImportError: cannot import name main

Explanation:

The exception appears after installing python-pip in the environment. looks like, the get-pip.py script from github is outdated which may be the reason for the exception.

Quick Fix:

Reinstalling python-pip from https://bootstrap.pypa.io website fixed the exception.

sudo apt-get purge python-pip
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py

Tags:

Amazon Web Service | Python

What is Messaging Fan-out?

by XDK 8. August 2019 00:22

Explanation:

Fan-out is a messaging pattern where messages are broadcast in a one-to-many arrangement.One of the very common architectural patterns is fan-out where an event is sent to multiple subscribers by a broker. An event can be like placing an order, which can then be handled by inventory service, record-keeping, as well as shipping service concurrently. These events can also be very frequent - like clickstreams, or search strings on a website. AWS allows for fan-out architecture with SNS topics, and SQS queues. SQS queue(s) can subscribe to SNS topics and receive any message sent to the SNS topic(s)

* SNS - Amazon Simple Notification Service (SNS) is a highly available, durable, secure, fully managed pub/sub messaging service that enables you to decouple microservices, distributed systems, and serverless applications. Additionally, SNS can be used to fan out notifications to end users using mobile push, SMS, and email.

* SQS - Amazon Simple Queue Service (SQS) is a fully managed message queuing service that enables you to decouple and scale microservices, distributed systems, and serverless applications.

Tags:

Amazon Web Service

What is serialization and Deserialization Python?

by XDK 7. August 2019 03:43

Explanation:

Python object serialization and deserialization is an important aspect of any non-trivial program. If in Python you save something to a file, if you read a configuration file, or if you respond to an HTTP request, you do object serialization and deserialization.

Serialization refers to the translation of object state into bytes to send it over the network or store it in hard disk. We need serialization because the hard disk or network infrastructure are hardware component and we cannot send objects because it understands just bytes and not objects

Pickling and Unpickling in Python.

Pickling in python refers to the process of serializing objects into binary streams, while unpickling is the inverse of that. It’s called that because of the pickle module in Python which implements the methods to do this.Pickling is useful when you want to save the state of your objects and reuse them at another time without losing any instance specific data. If you are using large files, CPickle is recommended. CPickle is implemented in C, making it much faster.

 

Tags: ,

Python

Amazon CloudFront vs Elastic Load Balancing

by XDK 7. August 2019 01:19

Amazon CloudFront is a web service that speeds up distribution of your static and dynamic web content, such as .html, .css, .js, and image files, to your users. CloudFront delivers your content through a worldwide network of data centers called edge locations.

Elastic Load Balancing automatically distributes incoming application traffic across multiple Amazon EC2 instances. It enables you to achieve greater levels of fault tolerance in your applications, seamlessly providing the required amount of load balancing capacity needed to distribute application traffic.

Tags:

Amazon Web Service

What is Route 53 in AWS?

by XDK 4. August 2019 16:32

Amazon Route 53 effectively connects user requests to infrastructure running inAWS – such as Amazon EC2 instances, Elastic Load Balancing load balancers, or Amazon S3 buckets – and can also be used to route users to infrastructure outside of AWS.

More...

 

Tags: , ,

Amazon Web Service

About the author

My name is Xavier Dilip Kumar Jayaraj having 16+ years of IT experience which includes solid experience and depth Knowledge in Application Life Cycle Management, Configuration Management, Implementation and Support using TFS on-premises and Azure DevOps. I have invested in gaining DevOps knowledege to expertise with Cloud Computing providers namely Microsoft Azure and Amazon Web Services in recent years. I am very positive to learn and adapt emerging technologies to client’s environment.

Microsoft Certified: Azure Administrator Associate

Microsoft Certified: Azure DevOps Engineer Expert

DevOps Engineer Certificate Program | Transcript 

OTP-AWSD5: AWS IoT: Developing and Deploying an Internet of Things

[PCEP-30-01] PCEP – Certified Entry-Level Python Programmer

Quotes I Like

"Failure will never overtake me if my determination to succeed is strong enough."  - Dr. APJ. Abdul Kalam

"Always be yourself, express yourself, have faith in yourself, do not go out and look for a successful personality and duplicate it." - Bruce Lee

"Technology is just a tool. In terms of getting the kids working together and motivating them, the teacher is the most important." - Bill Gates

"Innovation distinguishes between a leader and a follower." - Steve Jobs

CategoryList

Disclaimer

The information provided here is based on my expreriences, troubleshooting and online/offline findings. It can be used as is on your own risk without any warranties and I impose no rights.