When using Python you mostly rely on pip to install necessary libraries. Recently I ran the following command on my Mac:
pip install lxml
The result was the following output:
error: could not create '/Library/Python/2.7/site-packages/lxml': Permission denied
Obviously, writing to the folder /Library/ is not possible for a normal user account. There are several possible options to overcome this problem.
- You can use the command sudo pip install lxml to install the package
- You can use the command STATIC_DEPS=true sudo pip install lxml to install the package. This will download libxml2 and libxslt and build the source distribution afterwards.
- You use virtualenv to install the package only locally in your current project directory. See here for a good tutorial of virtualenv.
From my perspective option 3 is the cleanest way to install and manage lxml.
When using Entity Framework Database First it can happen that the code generated by the edmx file causes Code Analysis errors. This happens due to the fact that the t4-template misses the GeneratedCode attribute. It is pretty easy to modify the template to contain the necessary attributes.
Modify the context template
- Add using System.CodeDom.Compiler; at the right position in the using directives
- Add [GeneratedCode(“EntityModelCodeGenerator”, “22.214.171.124”)] above the class declaration line
Modify the template of the model classes
- Find EntityClassOpening and modify to the return a string starting with the GeneratedCode attribute
- Find <#=codeStringGenerator.UsingDirectives(inHeader: false)#> and add below using System.CodeDom.Compiler;
Today I was working on some data integration issues and was creating a BDC model. So as always, I created the model, added a finder method and modeled my entity. Then I deployed the solution and tried to creating an external list to test my finder method. So far so good, but when opening the External Content Type Picker the following error appeared: External Content Types are not available. Contact your system administrator.
What is that? Did my deployment fail? I opened the BCS service application to check if the model was correctly deployed. But it was there. My next idea was that something with the permissions was wrong, but everything was as usual.
So, what could be wrong? After a few minutes of staring onto the BDC model, I discovered it. My model was simply missing the specific finder method. After adding it, the external content type appeared in the picker. So, lesson learned for today: always add finder and specific finder method before deploying the model.
IT is a people’s business.
This is my quote of the week 🙂