If you didn't know, you can customize the terminal for VScode. In my case, I wanted to use cmder because Windows terminals suck; both of them cmd and powershell.
Fortunately, cmder has a guide for integrating it to VScode.
The interesting thing is when I tried using it with my Python workflow which includes virtual environements via Pipenv and I ran into a couple of problems.
Problem #1 Missing posh-git
Symptom Spits out a warning telling you that you are missing posh-git - 'Install-Module posh-git' and restart cmder"
Fix #1 Run from the admin level PShell: Install-Module posh-git
You might also get a error saying it might have an overlap with some other extension like say 'TabExpansion'.
Fix #2 Either run Fix#1 with the -AllowClobber or -Force option OR run it with a -Scope option: Install-Module posh-git -Scope CurrentUser
----
Problem #2 FunctionNotWritable (Cannot write to function prompt..)
Symptom Spits out the error; Also notice that your terminal prompt isn't prefixed by the activated virtual environment. Only happens when your doing Python with virtual environments.
Fix #1 Remove or comment out the -Options ReadOnly option on the cmder profile.ps1. Details here.
Blog. Repository of ideas/solutions. Web Developer. Data Labandero. Python. TypeScript. Dart. Flutter apps. VB6 free since 2003!
Showing posts with label Installing. Show all posts
Showing posts with label Installing. Show all posts
Wednesday, April 10, 2019
Troubleshooting Cmder Terminal in Visual Studio Code
Labels:
Installing,
python,
troubleshooting,
virtualenv,
vscode
Friday, January 4, 2019
Installing Scrapy on Windows
Data is the new oil they say and you want to start scraping sites for data. Fine! And since you are a Python developer you'd want to use Scrapy. Unfortunately for you you are a Windows user and errors abound.
Anyhow, you run pip install scrapy and you run into an error:
The error here is one of dependencies of Scrapy which is Twisted. Fortunately this is fixable.
The first thing we're going to do is download the "binary" wheel file for Twisted. There's a trick here though, YOU MUST DOWNLOAD THE CORRECT ONE THAT MATCHES YOUR PYTHON VERSION. So if you are on Python 3.6, you're looking for something that reads like Twisted-18.9.0-cp36-cp36m-win32.whl; if Python 3.7 then you're looking for something with cp37-cp37m. You get the idea.
The 32-bit or 64-bit probably also matters but I didn't test it.
Once you have that file downloaded somewhere, you can then do a pip install .
Try installing Scrapy again and you should be good to go.
As an added bonus, this seems to fix other Python packages in Windows that require the Visual Studio Windows C++ SDK like the mysql-python.
Tip for Pipenv users:
1. pipenv shell
2. pip install
3. pipenv sync
Anyhow, you run pip install scrapy and you run into an error:
| Scrapy failing to pip install in Windows |
The error here is one of dependencies of Scrapy which is Twisted. Fortunately this is fixable.
The first thing we're going to do is download the "binary" wheel file for Twisted. There's a trick here though, YOU MUST DOWNLOAD THE CORRECT ONE THAT MATCHES YOUR PYTHON VERSION. So if you are on Python 3.6, you're looking for something that reads like Twisted-18.9.0-cp36-cp36m-win32.whl; if Python 3.7 then you're looking for something with cp37-cp37m. You get the idea.
The 32-bit or 64-bit probably also matters but I didn't test it.
Once you have that file downloaded somewhere, you can then do a pip install
Try installing Scrapy again and you should be good to go.
As an added bonus, this seems to fix other Python packages in Windows that require the Visual Studio Windows C++ SDK like the mysql-python.
Tip for Pipenv users:
1. pipenv shell
2. pip install
3. pipenv sync
Labels:
Installing,
python,
Scrapy,
troubleshooting,
Twisted
Tuesday, March 31, 2015
My summer 2015 MEAN project: Setting up
So let’s get started. my set up:
- Visual Studio: community edition with Nodejs tools. I can hear the WTFs from here. Why? Because it’s an excellent IDE for node development, we can get it for free and I know a couple of people who go into a blind rage when I something from the evil empire. Yes, let the hate flow through you.
But seriously, any text editor will do if you don’t to use VS. - Fiddler. We need something to debug and test our REST API. We could just use a web browser like…...IE (hehehehe) but sometimes we need to drill down to the raw parts to debug. Besides, it’s another free software.
Postman can be an alternative. - Sign up for Azure. This is the iffy part because you need a credit card. Azure does have a generous free trial and a teacher/student program via DreamSpark. But if Azure rubs you the wrong way then you can do a local VM like turnkey. It’s the same thing. But if you really, really must use something else then there's Openshift or DigitalOcean or Heroku or Amazon. All these services have free trial accounts in some form.
- Github via SourceTree. Someone once said, “you’re not a developer unless you have github.” But if you go all ghetto on me, there’s Bitbucket or Codeplex.
As for SourceTree, it’s another free software for code repos. It works with Git and Mercurial repos. You could opt for a the command line, I won’t judge you. I mean, I can’t judge someone on how they enjoy pain. - Nodejs and NPM stuff. Install node is straight-forward affair. The stuff you have to do after sort of isn’t. The tribe of terminal user will rejoice this part.
- ExpressJS. We need it because a node app isn't much without express
- bower. We need bower because I’m lazy and don’t want to the whole dance of google, download, unpack and copy for web stuff.
- mongoose. Because MongoDB database.
- Mongolab account. Mongolab does MongoDB as a Service and they have a free plan with 500MB on it to try out. If you don’t want to then you can install MongoDB on your PC or use a VM.
Labels:
Installing,
nodejs,
Tutorial
Friday, December 5, 2014
Putting Groovy on Mint (and other Linux distros) the easy way
Installing Groovy on any Linux distro is a pain in the ass. Generally, the procedure is:
Just do this to install GVM:
And then do this to install Groovy.
That should install the latest version of groovy and we're off and running with groovy development.
- Install the requisites. This could be an involved process because you could be potentially install a lot of stuff but at minimum just need Java.
- Download the binaries for groovy. If your Linux distro has a repo like Debian, I don't recommend using it because it not the latest.
- Do a bit of file handling and doing a bunch of sym links to the binaries.
- Configure your bash shell for groovy. Just like step 3, not fun and just plain tedious.
Just do this to install GVM:
curl -s get.gvmtool.net | bash
And then do this to install Groovy.
gvm install groovy
That should install the latest version of groovy and we're off and running with groovy development.
Labels:
Groovy,
Installing,
Java,
Ubuntu
Thursday, June 6, 2013
Our Database: Dropping MySQL for MariaDB
This is part 2 of my Resteasy Tapestry with AngularJS tutorial. We will be fleshing out the database that we will be using for this tutorial/project.
I will be using MariaDB in this. I could use MySQL but ever since Oracle took it over, I've been slightly uncomfortable in using/recommending it. Besides, MariaDB is a drop-in replacement, so any code you wrote (or will write) for MySQL will be OK with a MariaDB database.
As not to be bogged down by database design details, we'll just have a 1 table database for Contacts.
As for our management tool, we will be using Netbeans. Yes, Netbeans. (I'll let that sink in.)
You can manage your MariaDB database in Netbeans just by registering it and running queries against it. And it does have a few GUI features like a 'Create-Table' wizard. To register your MariaDB database(I'm assuming that you have Netbeans and MariaDB installed already) do the following:
That should execute without a problem. As for creating a "Contacts" table, that should be fairly straight-forward. Just open up the new tangledb database and on the table folder, right-click and add new table.
As for the columns:
- id (integer, pk)
- firstname (varchar(50), nullable)
- lastname (varchar(50), nullable)
- nickname (varchar(50), not nullable)
- birthday (date)
- mobile (varchar(15), nullable)
- landline (varchar(15), nullable)
- e-mail (varchar(150), nullable)
Click OK and there you have your MariaDB database.
I will be using MariaDB in this. I could use MySQL but ever since Oracle took it over, I've been slightly uncomfortable in using/recommending it. Besides, MariaDB is a drop-in replacement, so any code you wrote (or will write) for MySQL will be OK with a MariaDB database.
As not to be bogged down by database design details, we'll just have a 1 table database for Contacts.
As for our management tool, we will be using Netbeans. Yes, Netbeans. (I'll let that sink in.)
You can manage your MariaDB database in Netbeans just by registering it and running queries against it. And it does have a few GUI features like a 'Create-Table' wizard. To register your MariaDB database(I'm assuming that you have Netbeans and MariaDB installed already) do the following:
- Download the java-client driver
- In Netbeans, go to the "Services" tab, right-click on it and select "New Connection"
- Pick new driver
- On the new window, locate the java-client driver you just downloaded
- Set the driver class to:
org.mariadb.jdbc.Driver - Pick a name for this new connection
You should be then able then to connect to your MariaDB instance. To test, try executing the command:
create database tangledb;That should execute without a problem. As for creating a "Contacts" table, that should be fairly straight-forward. Just open up the new tangledb database and on the table folder, right-click and add new table.
As for the columns:
- id (integer, pk)
- firstname (varchar(50), nullable)
- lastname (varchar(50), nullable)
- nickname (varchar(50), not nullable)
- birthday (date)
- mobile (varchar(15), nullable)
- landline (varchar(15), nullable)
- e-mail (varchar(150), nullable)
Click OK and there you have your MariaDB database.
Labels:
Installing,
MariaDB,
Netbeans,
Tutorial
Saturday, October 13, 2012
Installing Maven 3 in Ubuntu 12.04 Precise
Ubuntu needs to no explanation and Maven is software project management tool. It manages software dependencies and how your code is compiled and deployed. Its pretty handy because now I don't have to hunt down jars that my other jars need and no more copying the binaries to target folders.
Unfortunately, the Ubuntu repos are a bit slow. The repos only have Maven2. Now, let's get to installing Maven3.
1. Install the Nate Carlson's PPA for Maven3
2. Open a terminal console and type in: sudo apt-get update
3. After update finishes, type in: apt-get install Maven3
You now have Maven3 installed but you can't run it from the terminal because you didn't set the paths. If you try to type: mvn --version; That should fail. To fix this you have to make a symbolic link from where Maven3 is installed to where it can be run it "globally" from the terminal.
You just created a symbolic link in /usr/bin/mvn. The mvn command now should work in your terminal.
Update (3/29/2013):
Unfortunately, the Ubuntu repos are a bit slow. The repos only have Maven2. Now, let's get to installing Maven3.
1. Install the Nate Carlson's PPA for Maven3
2. Open a terminal console and type in: sudo apt-get update
3. After update finishes, type in: apt-get install Maven3
You now have Maven3 installed but you can't run it from the terminal because you didn't set the paths. If you try to type: mvn --version; That should fail. To fix this you have to make a symbolic link from where Maven3 is installed to where it can be run it "globally" from the terminal.
$ sudo ln -s /usr/share/maven3/bin/mvn /usr/bin/mvn
You just created a symbolic link in /usr/bin/mvn. The mvn command now should work in your terminal.
Update (3/29/2013):
Caution: command "sudo add-apt-repository ppa:natecarlson/maven3" did not work on my Ubuntu and and had to run "sudo add-apt-repository -rm ppa:natecarlson/maven3" to get my apt-get to work again. ~AmirHD
See this Stackoverflow thread.
Labels:
Installing,
Maven,
Ubuntu
Subscribe to:
Posts (Atom)

